Task with "coding"

kolev02

New member
Joined
Aug 5, 2018
Messages
7
Task

Hi,
I am solving task which can be solved with "coding". I will be really glad if someone can help me with solving it.

How many five-digit numbers perfom this:
abcde - number
a * b * c * d * e = 2187
?

Thank you in advance!
Greetings,
Kaloyan
 
Last edited:
Hi,
I am solving task which can be solved with "coding". I will be really glad if someone can help me with solving it.

How many five-digit numbers perfom this:
abcde - number
a * b * c * d * e = 2187
?

Thank you in advance!
Greetings,
Kaloyan
Please share your work with us ...even if you know it is wrong.

If you are stuck at the beginning tell us and we'll start with the definitions.

You need to read the rules of this forum. Please read the post titled "Read before Posting" at the following URL:

http://www.freemathhelp.com/for
 
Please share your work with us ...even if you know it is wrong.

If you are stuck at the beginning tell us and we'll start with the definitions.

You need to read the rules of this forum. Please read the post titled "Read before Posting" at the following URL:

http://www.freemathhelp.com/for

Okey. Thank you!

My solve:
2187 = \(\displaystyle 3^{7}\)
We have to give 7 multipliers "3" to the abcde (number). I think from here we have to coding but I do not know how!
 
You need more information, else results like this will occur:
2187 * 1 * 1 * 1 * 1 = 2187
1 * 2187 * 1 * 1 * 1 = 2187
...and so on

With these conditions:
a =< b =< c =< d =< e =< 10
there are only 2 solutions:
1,3,9,9,9
3,3,3,9,9
 
You need more information, else results like this will occur:
2187 * 1 * 1 * 1 * 1 = 2187
1 * 2187 * 1 * 1 * 1 = 2187
...and so on
2187 needs to be a product of five digits. Why not use nested loops (generating numbers from 11111 through 99999) and test each permutation?
 
Last edited:
Вие се нуждаете от повече информация, ще се появят другаде подобни резултати, като:
2187 * 1 * 1 * 1 * 1 = 2187
1 * 2187 * 1 * 1 * 1 = 2187
... и така нататък

с тези условия :
a = <b = <c = <d = <e = <10
има само 2 решения:
1,3,9,9,9
3,3,3,9,9
I translated the task exactly as it is in my book.
 
Last edited by a moderator:
Do you know how to code nested loops?
You did not understand me. I do not have to solve this task with coding it. In Bulgaria there's a math method of solving called "coding". No programming. I just need to solve the task with math.
 
You need more information, else results like this will occur:
2187 * 1 * 1 * 1 * 1 = 2187
1 * 2187 * 1 * 1 * 1 = 2187
...and so on

With these conditions:
a =< b =< c =< d =< e =< 10
there are only 2 solutions:
1,3,9,9,9
3,3,3,9,9

2187 needs to be a product of five digits. Why not simply loop each digit from 1 through 9, and test each combination?

Some of us seem to have misinterpreted the problem. Since what you are looking for is a "five-digit number", we know that the five numbers must be digits (integers n, 0 <= n <10), and that order matters. So the solutions are permutations of the two "solutions" Denis listed.

If you want a more efficient program, you might combine the two ideas above. You noted that the five digits are powers of 3, which leads to Denis' observation. You could write a looping program to permute each of his sets of digits; or you might just try listing all sequences consisting of 1, 3, and 9, and keep track of the product (or just of the sum of the exponents used), stopping when you exceed 3^7. This gives you fewer numbers to try, and makes the test much quicker (as no division will be needed).

Perhaps you should tell us the context. Are you just being introduced to programming, or is this for a number theory course, or something else? Do you know whether you are expected to give a basic answer, or an efficient one? And does the program actually have to list and count, or can it just calculate by some combinatorial formula?
 
With getting actual 5digit numbers (missed that!),
there are 30 solutions:
1: 13999
2: 19399
3: 19939
...
28: 99391
29: 99913
30: 99931
 
You did not understand me. I do not have to solve this task with coding it. In Bulgaria there's a math method of solving called "coding". No programming. I just need to solve the task with math.
You need to solve the exericse not just with math, but with a specific, mathematical method (known as "coding", in Bulgaria).

I apologize for not understanding your original post. I have never been to Bulgaria. ;)


Yes I can do this but I just wanna find new and better way to solve such tasks.
It would have been helpful, had you posted this information at the beginning.

In the forum guidelines, we ask students to describe their exercise completely and to ask specific questions.

I look forward to seeing what "coding" is all about. :cool:
 
Last edited:
You did not understand me. I do not have to solve this task with coding it. In Bulgaria there's a math method of solving called "coding". No programming. I just need to solve the task with math.

Please show us an example of "coding", or how it is explained, so we can see what it is and perhaps determine the correct translation for the term. Ideally, you might be able to give us a link to an explanation, which we can have translated and see it all. As you have seen, "coding" in English means programming; but I can imagine various other things you could mean by it.
 
:idea: kolev02: The reason your quoted material was not posting properly is that extra spaces had been inserted within the tags.

Could it be that you are using a third-party translation service, and they are inserting these spaces? If so, you'll need to use the Preview Post button, to proofread what your post will look like, before submitting it. Please remove the spaces around the equal sign and after the forward slash, as shown:

[QUOTE = Denis; 123456] [/ QUOTE]

Thank you!
 
I found an example task.

How many four-digit numbers have a sum of digits 9?
Solve:
8 ball - 4 children (8 coz the first children must have 1 ball / the number can't start with 0)
Let D mean - give me a ball and C mean - next kid
In this situation we have 8D (coz 8 children want a ball) and 3C (
we have three distances between 4 trees / two distances between 3 pens)
and the final result : \(\displaystyle \frac{11!}{8! . 3!}\) = 165 if I can calculate
 
I found an example task.

How many four-digit numbers have a sum of digits 9?
Solve:
8 ball - 4 children (8 coz the first children must have 1 ball / the number can't start with 0)
Let D mean - give me a ball and C mean - next kid
In this situation we have 8D (coz 8 children want a ball) and 3C (
we have three distances between 4 trees / two distances between 3 pens)
and the final result : \(\displaystyle \frac{11!}{8! . 3!}\) = 165 if I can calculate

I suppose you have tried to summarize something much more detailed, which makes this hard to follow. As I understand it, you are reinterpreting the problem (about four-digit numbers) as a new problem where 4 children are dividing 8 indistinguishable balls among them; the first must have at least one ball, but the others may have none. (This is a partitioning problem.) You want to know how many ways this can be done, which is equivalent to the original problem. I don't see how the notation "8D 3C" helps. Then you are remodeling the problem yet again, as something unstated about distances between trees and pens. I can't follow that at all.

But I think what you are probably doing is what we call in English "Stars and Bars", because we remodel the problem in terms of figures like |***||**|****|, which represents either 4 "bins" (pens?) containing 3, 0, 2, 4 balls respectively, making the required total of 9; or alternatively just an arrangement of stars and bars, taking the figure literally. This gives us a total of 11 positions, if we ignore the two outer bars which are fixed, of which we choose 3 to be bars, so that the total is "11C3", which is the calculation you show. But then you would have to subtract the arrangements with nothing in the first bin.

Does this sound like what you were taught? If so, you can search for "stars and bars" to find information. Possibly "coding" means that, or perhaps it means the more general idea of remodeling a problem, changing its representation to one that can be solved.
 
I found an example task.
How many four-digit numbers have a sum of digits 9?
Solve:
8 ball - 4 children (8 coz the first children must have 1 ball / the number can't start with 0)
Let D mean - give me a ball and C mean - next kid
In this situation we have 8D (coz 8 children want a ball) and 3C (
we have three distances between 4 trees / two distances between 3 pens)
and the final result : \(\displaystyle \frac{11!}{8! . 3!}\) = 165 if I can calculate
(next time, use "because" instead of "coz")
Like DrP, I can't follow your post completely....
however, 165 is correct IF 0 is allowed in positions 2,3,4 (but not in position 1).
In ascending order:
1: 1008
2: 1017
3: 1026
...
163: 8010
164: 8100
165: 9000
...which all means:
there are 165 4digit numbers with sum of digits = 9.
 
I suppose you have tried to summarize something much more detailed, which makes this hard to follow. As I understand it, you are reinterpreting the problem (about four-digit numbers) as a new problem where 4 children are dividing 8 indistinguishable balls among them; the first must have at least one ball, but the others may have none. (This is a partitioning problem.) You want to know how many ways this can be done, which is equivalent to the original problem. I don't see how the notation "8D 3C" helps. Then you are remodeling the problem yet again, as something unstated about distances between trees and pens. I can't follow that at all.

But I think what you are probably doing is what we call in English "Stars and Bars", because we remodel the problem in terms of figures like |***||**|****|, which represents either 4 "bins" (pens?) containing 3, 0, 2, 4 balls respectively, making the required total of 9; or alternatively just an arrangement of stars and bars, taking the figure literally. This gives us a total of 11 positions, if we ignore the two outer bars which are fixed, of which we choose 3 to be bars, so that the total is "11C3", which is the calculation you show. But then you would have to subtract the arrangements with nothing in the first bin.

Does this sound like what you were taught? If so, you can search for "stars and bars" to find information. Possibly "coding" means that, or perhaps it means the more general idea of remodeling a problem, changing its representation to one that can be solved.

I wrote that a little too quickly, without time to check the problem. Your sum is 9, not 8. Having 4 bins with 9 balls, if you allowed 0 in any, you would be picking 3 of 12 places for bars; with 0 not allowed in the first bin, we can think of putting one star in the first bin before allotting others, or of splitting only 8 balls among bins and then adding one to the first. This makes the answer 11C3 = 165 as has been stated. This must be what they are saying about 8 balls.
 
Top