You are not logged in.
hi all,
I have a bunch of numbers; they are constructed of digits without repetition, and in this numbers a digit is always greater lower value digits. This numbers are categorized according to the its number of digit; in each category all possible numbers are exist.
here a simple example:
assume the numbers constructed of 1, 2, 3, 4, 5 and they are catagorized as follow according to number of digits:
1-digit: 1, 2, 3, 4, 5
2-digit: 12, 13, 14, 15, 23, 24, 25, 34, 35, 45
3-digit: 123, 124, 125, 134, 135, 145, 234, 235, 245, 345
4-digit: 1234, 1235, 1245, 1345, 2345
5-digit: 12345
the question is: how I can find a number by knowing the category and the number of its place in row. for example by knowing category number 2 and sequence number 7, I have to obtain: 25
since it becomes cumbersome at higher orders, I need to formulate the procedure. a formula or a algorithm is appreciated.
Thank you:)
I have a string of terms starts with ∑(n-m) {down limit of summation is m=2 and upper limit is m=(n-1). in this string each term is constructed according to the sub-terms of the previous term for example:
fist term is ∑(n-2) = (n-2)+(n-3)+(n-4)+(n-5)+...(n-(n-1)); the second term is ∑(n-3)+∑(n-4)!+∑(n-5)+....+∑(n-(n-1))
the third term will be summation of second side of the following equations:
in second term we have ∑(n-3) which is (n-3)+(n-4)+(n-5)...+(n-(n-1)) so one sub-term in third term is ∑(n-4)+∑(n-5)+∑(n-6)+...∑(n-(n-1))
in second term we have ∑(n-4) which is (n-4)+(n-5)+(n-6)...+(n-(n-1)) so another sub-term in third term is ∑(n-5)+∑(n-6)+∑(n-7)+...∑(n-(n-1))
...
in second term we have (n-(n-2)) which is (n-(n-2))+(n-(n-1)) so the last sub-term in third term is ∑(n-(n-1))=1
the other terms in this string are constructed as it is stated according to the previous term. In above equations "∑" means summation of the term located front of it starting from indicated number to n-1. for example ∑(n-4)= (n-4)+(n-5)+(n-6)+....+(n-(n-1).
I need a single formula that enables me to obtain each term. an algorithm or a program in C language is also appreciated.
Thank you very much
Sorry,
I mean summation, not multiplication.
Hi,
lets put first two terms aside.
Doing so, I have a string of terms starts with (n-2)!. in this string each term is constructed according to the sub-terms of the previous term for example:
fist term is (n-2)! = (n-2)+(n-3)+(n-4)+(n-5)+...(n-(n-1)); the second term is (n-3)!+(n-4)!+(n-5)!+....+(n-(n-1))!
the third term will be summation of second side of the following equations:
in second term we have (n-3)! which is (n-3)+(n-4)+(n-5)...+(n-(n-1)) so one sub-term in third term is (n-4)!+(n-5)!+(n-6)!+...(n-(n-1))!
in second term we have (n-4)! which is (n-4)+(n-5)+(n-6)...+(n-(n-1)) so another sub-term in third term is (n-5)!+(n-6)!+(n-7)!+...(n-(n-1))!
...
in second term we have (n-(n-2)) which is (n-(n-2))+(n-(n-1)) so the last sub-term in third term is (n-(n-1))!
the other terms in this string are constructed as it is stated according to the previous term. I need a single formula that enables me to obtain each term.
an algorithm or a program in C language is also appreciated.
Thank you very much
Hi all,
I have following string, and need to develop a single formula for all terms.
n, (n-1), (n-2)!, (n-3)!+(n-4)!+(n-5)!+...(n-(n-1))!, ((n-4)!+(n-5)!+(n-6)!+...(n-(n-1))!)+((n-5)!+(n-6)!+(n-7)!+...(n-(n-1))!)+...+(n-(n-1))!, ((n-5)!+(n-6)!+(n-7)!+...(n-(n-1))!)+((n-6)!+(n-7)!+(n-8)!+...(n-(n-1))!)+...+(n-(n-1))!
as illustrated after 3rd term, each sub-term (n-m)! in next term turn to (n-(m-1))!+ (n-(m-2))!+ (n-(m-3))!+....+(n-(n-1))!
any idea is appreciated
thank you:)
Thank you
However, for example, 1+0 and *+* result same value but they are not logically equal.
1, 0 , * indicate state of a something ( capacitor voltage in my study), therefore I cannot say 1+0 equals *+*.
is there another way?
thank you
Hi,
it maybe silly question because my field is not math.
I have following set of equations:
1+0=*
*+*=*
1+*=1
1+1=1
0+0=0
0+*=0
could I able to write it in 3 line as follow or it is mathematically wrong? if it is wrong how can I write it in 3 line?
1+0 and *+*=*
1+* and 1+1=1
0+0 and 0+*=0
Thank you:)
Hi Dear Bobbym,
it's desirable not to calculate all possible sums, because it's cumbersome and time consuming. I wonder if there is a way to know whether a subset exists that add up to desired value without calculating all possibilities?
lets simplify and look to the problem of another perspective:
there is a main set of number in which the smallest number is 1. the midst numbers can be variable but i am sure that every member is unique (no repetition), and the members have such values that any number between 1 and the N*(N-1) (N is number of members) can be constructed by various combination (just adding) of them.
For Example: 1, 2, 4, 5
we have 1; 2; 2+1=3; 4, 4+1=5, 5; 4+2, 5+1=6; 4+2+1, 5+2=7; 5+2+1=8; 5+4=9; 5+4+1=10; 5+4+2=11, 5+4+2+1=12.
the main set has above conditions.
Now there is a set that is subset of above set for example A {1, 2, 4} or {1, 4} or any other subset, I like to know whether a desired number that is less than N*(N-1) (12 in this example) can be constructed by a subset of the set which was itself subset of main set.
For Example: Whether is there a subset of set A which its members add up to desired value ( for Example 6)?
Since the number of members of sets can be very large, dynamic programming need too much time. so I like to find out is it possible in first step and if it is possible then the program searches for that subset. if it isn't possible, goes to another subroutine.
thank you
would you please explain how?
Thank you
the problem is somewhat complicated in express! the set is variable according to condition. I have a main set which in it the smallest number is 1 and the greatest number is N(N-1) (N is number of set's members). but the set which I like find a subset that add up to the specific number is itself a subset of the main set. mid numbers in main set have difference more than 2, and there is no repeated number. the knapsack is of 01 kind (we cannot choose a number twice or more). the desired number is smaller than largest number in main set but can be larger than the greatest number in set which I like to find the subset that add up to this number.
Example:
desired number:8
the main set:1, 3, 7, 12
the set can be 1, ,3, 7 or any other subset of above set.
Thank you very much for taking your valuable time on this problem.
Hi all,
I have a problem in engineering which can be done by dynamic programming known as knapsack problem in computer and math science.
the problem is:
I have a set of numbers (n numbers) and I like to find a subset that add up to specific number. the complexity of this problem is O(2^n). so it is time consuming process. In first step I like to determine is there any subset if the answer be yes then dynamic programming runs to find subset.
so there is my question: is there any way to find whether there is a subset that add up to specific number by formula without examining all possibilities (dynamic programming) ? I don't need to find the subset! just I want a yes or no.
thank you:)