 |
|
| Science Forum Index » Mathematics Forum » Really odd sort of permutation thing... |
|
Page 1 of 1 |
|
| Author |
Message |
| CBlair1986 |
Posted: Thu Mar 22, 2007 1:26 am |
|
|
|
Guest
|
Hi all! I have something that has been on my mind for a while, now,
and I just can't figure it out. Perhaps it is due to my limited
education, but I figured that I might find some help here. You all
seem like smart people.
Okay, so the problem basically boils down to this:
* You have a set of N numbers, all single-digit
* Two numbers are always connected by one of: addition(+),
subtraction(-), multiplication(*),
division(/), modulation(%), exponentiation(^).
* Two or more numbers may be surrounded by parentheses, regardless of
redundancy, i.e.
(a + b) + c + d
* Two or more numbers may also be concatenated together to form a
two-, three-, four-, ...,
n-digit number, i.e.
ab + c + d
Now, what I've been looking for, what has been on my mind for a while,
is the formula telling how many variations for a given N.
Solving for N=1 is simple, as there is just one possibility:
a
Solving for N=2 is also simple, since parentheses don't come into
play. All you have to worry about are the operators:
a + b, a - b, a * b, a / b, a % b, a ^ b, ab
As you can see, it has just seven possibilities for N=2.
Now, I'm not entirely sure if my calculations are correct, but for
N=3, there are 162 combinations. I'm fairly sure it climbs higher
fairly quickly.
Any help will be greatly appreciated, and will make me happy, along
with perhaps a quick (or in-depth, if you prefer) explanation as to
how you obtained the result.
Thank you for reading! |
|
|
| Back to top |
|
|
|
| Divij Rao |
Posted: Thu Mar 22, 2007 1:51 am |
|
|
|
Guest
|
a very good question!
we have 6 ways to combine 2 no.s, we will count ab later
for three no.s, the no of ways to use these 6 in 2 posn.s a_b_c is 6C2
there are 3 positions for a,b,c so 3p3=6
means, there are 15x6=90 ways of arranging these no.s.
now, selecting a,b,c from1,2,3,4,5,6,7,8,9,0[10 no.s]
10c3=120 ways.
therefore it comes to 90+120 ways. |
|
|
| Back to top |
|
|
|
| CBlair1986 |
Posted: Thu Mar 22, 2007 2:36 am |
|
|
|
Guest
|
On Mar 22, 1:51 am, "Divij Rao" <divij_urdb...@yahoo.co.in> wrote:
[quote:614a834cfc]a very good question!
we have 6 ways to combine 2 no.s, we will count ab later
for three no.s, the no of ways to use these 6 in 2 posn.s a_b_c is 6C2
there are 3 positions for a,b,c so 3p3=6
means, there are 15x6=90 ways of arranging these no.s.
now, selecting a,b,c from1,2,3,4,5,6,7,8,9,0[10 no.s]
10c3=120 ways.
therefore it comes to 90+120 ways.
[/quote:614a834cfc]
Ah! I think you might have misunderstood what I asked. The numbers a,
b, c, ..., n cannot be rearranged. They remain in their places, no
moving about. Also, it does not matter exactly *which* numbers a, b,
c, etc. are, just that they are there.
Also, not just three numbers, but any number of numbers. What I'm
looking for is a formula f(n) where n is the number of single-digit
numbers. The formula would then calculate out to the number of
different possibilities. Sorry for the confusion! |
|
|
| Back to top |
|
|
|
| Daniel McLaury |
Posted: Thu Mar 22, 2007 2:44 am |
|
|
|
Guest
|
[quote:c4ae5fb53b]Okay, so the problem basically boils down to this:
* You have a set of N numbers, all single-digit
* Two numbers are always connected by one of: addition(+),
subtraction(-), multiplication(*),
division(/), modulation(%), exponentiation(^).
* Two or more numbers may be surrounded by parentheses, regardless of
redundancy, i.e.
(a + b) + c + d
* Two or more numbers may also be concatenated together to form a
two-, three-, four-, ...,
n-digit number, i.e.
ab + c + d
Now, what I've been looking for, what has been on my mind for a while,
is the formula telling how many variations for a given N.
Solving for N=1 is simple, as there is just one possibility:
a
Solving for N=2 is also simple, since parentheses don't come into
play. All you have to worry about are the operators:
a + b, a - b, a * b, a / b, a % b, a ^ b, ab
As you can see, it has just seven possibilities for N=2.
Now, I'm not entirely sure if my calculations are correct, but for
N=3, there are 162 combinations. I'm fairly sure it climbs higher
fairly quickly.
Any help will be greatly appreciated, and will make me happy, along
with perhaps a quick (or in-depth, if you prefer) explanation as to
how you obtained the result.
Thank you for reading!
[/quote:c4ae5fb53b]
If you are asking in the case of given numbers for a, b, c, and so on,
then the answer is going to depend on the choice of those numbers.
For instance, if a = b = 2, then a + b = a * b = a ^ b and a - b = a %
b, so there are really only three possibilities. I think you are
actually asking, though, "How many distinct functions of a, b, c, ...
can we produce that look like described above, where the arguments are
taken in the set {0, 1, 2, ... 9}?" This is going to be almost
impossible to calculate in general, because you don't know whether or
not throwing in parentheses is changing anything. I.e. we have
(a + b) + c = a + (b + c) = a + b + c
so we don't want to count all of these expressions separately;
however, in general
(a * b) + c != a * (b + c)
so we do want to count those expressions separately. Further, it's
not entirely clear what your juxtaposition operator would do in a case
like a(b + c), since b + c could be greater than 10. Does it always
give a*10 + b regardless of b, or a*10 + b%10, or does stick on an 'a'
to the left of whatever is there? What about expressions like a(b/c)
or (a/b)%c or a%(b/c) when b/c isn't an integer? In fact, division
isn't really safe on its own, as the denominator could always be zero,
and the same thing holds for a^b when a = b = 0. (Though a couple of
these problems could be fixed by adding a "not a number" element to
your solution set. But you'd have to specify how that would work as
well.)
So, unfortunately, this question doesn't really mean anything, since
four of your binary operators aren't actually defined on all of Q. If
you fix it up enough, you'll eventually arrive at a question which has
an answer, but it will be ugly and not particularly enlightening.
If you're interested in a question that *does* have an answer, and one
where the solution method isn't akin to removing a dead beached whale
from public view, try to answer your original question with the
operators cut back to +, *, and () and the restriction about single-
digit numbers dropped.
If you're trying to answer the Car Talk puzzler, the only solution is
123 - 45 - 67 + 89 = 100. |
|
|
| Back to top |
|
|
|
|
|
All times are GMT - 5 Hours
The time now is Wed Dec 02, 2009 7:17 pm
|
|