What is the smallest possible number I spent an hour on this problem, but have no clue how to solve the it. Could anyone help me?
The problem ---- The numbers from 1 through 8 are separated into two sets, A and B. The numbers in A are multiplied together to get a. The numbers in B are multiplied together to get b. The larger of the two numbers a and b is written down. What is the smallest possible number that can be written down using this procedure? 
 A: First note that the optimal values for $a$ and $b$ will both be even: otherwise, if say $a$ is odd then it will be at most $1\cdot3\cdot5\cdot 7 = 105$, so that $b-a \ge 279$ which we shall soon see is not optimal.
When $a$ and $b$ have the same parity, the factorization $8! = a\cdot b$ corresponds uniquely to a difference of squares
$$8! = \left(\frac{a+b}2\right)^2 - \left(\frac{a-b}2\right)^2.$$
Thus we can simply look for the smallest integer $y$ satisfying $8! = x^2-y^2$.  Noting that $x$ increases along with $y$, we can just try successive values of $x$, starting with the smallest conceivable value $201$ (any smaller and we'd have $x^2 < 8!$):
$$(201)^2 - 8! = 81 = 9^2.$$
Oh look, we already have a solution!  So $(a-b)/2 = 9$ and $(a+b)/2 = 201$, so $a = 210$ and $b=192$.  This is a very old (and now fairly obsolete) factoring technique known as Fermat factorization.  It happened to work splendidly well in this case, but usually it takes more trial and error.  For small numbers like $40320$ it's not a bad way to find the two factors that are closest together.
We still need to check that $210$ (or $192$) can be factored into some combination of numbers from $\{1,2,\ldots,8\}$: we might have had some bad luck if, we are forced to split the factor $6$ into $2\cdot 3$ because there's no other way to get $210$, in which case we'd have to look for the next value of $x$ and $y$.  But happily, $210 = 2\cdot3\cdot5\cdot7$ and the complementary factors $1\cdot4\cdot6\cdot 8$ obviously yield $192$, so the first value of $x$ and $y$ worked out.
A: The greedy algorithm is a start.  Put $8$ in one set.  Then put each number in the set with smaller product.  It may not be optimal, but it gives a good target to beat.  That gives $\{8,5,4,1\}$ and $\{7,6,3,2\}$ for $252$
A: While I don't know how to prove it mathematically the C++ program below shows how to find it via brute force.
Output:
best mask = 86, with a value of 210
A = [2,3,5,7] = 210
B = [1,4,6,8] = 192

Source:
#include <stdio.h>

void CalculateMask(unsigned int mask, unsigned int &a, unsigned int &b, unsigned int &highest)
{
    a = 1;
    b = 1;

    for (unsigned int i = 0; i < 8; ++i)
    {
        unsigned int bit = 1 << i;

        if (mask & bit)
            a *= (i+1);
        else
            b *= (i+1);
    }

    highest = a > b ? a : b;
}

int main(int argc, char** argv)
{
    unsigned int bestMask = 0;
    unsigned int bestValue = 0;

    for (unsigned int i = 0; i < 128; ++i) {
        unsigned int a, b, highest;

        CalculateMask(i, a, b, highest);

        if (i == 0 || highest < bestValue) {
            bestMask = i;
            bestValue = highest;
        }
    }

    printf("best mask = %u, with a value of %u\r\n", bestMask, bestValue);

    unsigned int a, b, highest;
    CalculateMask(bestMask, a, b, highest);

    printf("A = [");
    for (unsigned int i = 0; i < 8; ++i) {

        unsigned int bit = 1 << i;

        if (bestMask & bit)
            printf("%u,", i+1);
    }
    printf("%c] = %u\r\n", 8, a);

    printf("B = [");
    for (unsigned int i = 0; i < 8; ++i) {

        unsigned int bit = 1 << i;

        if ((bestMask & bit) == 0)
            printf("%u,", i+1);
    }
    printf("%c] = %u\r\n", 8, b);

    return 0;
}

A: 

*8*6*4*1=192, while 7*5*3*2=210.


The 3*2 can be interchanged with the 6, and of course the one can go anywhere.
A: The closest possible sets are {1,5,6,7}=210 and {2,3,4,8}=192; the answer would be 210. 
A: I would go about solving it in this way - 
$$8!=40320$$
Find the factors of this number which is closest to it's square root $201$
For an understanding of the question, It's just that you pick any $4$ numbers from $1$ to $8$. The product of these $4$ numbers must be the least possible number such that it is greater than the product of the other $4$.
For example, as the other answers say, pick $7,5,3,2$ and multiply them. The answer $210$ is greater than that you get by multiplying $8,6,4,1$ which is $192$
