mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2010-03-07, 23:59   #1
SarK0Y
 
SarK0Y's Avatar
 
Jan 2010

2·43 Posts
Default X-Y==Min

Good Time to All, Amici.

i got following math problem: to split up number array into pairs of arrays where X[t] & Y[t] are multiplications of numbers of gotten arrays (in t'th pair) with condition: |X(0)-Y(0)|==MIN(0), |MIN(0)-(X(1)-Y(1))|==MIN(1), ..., |MIN(n-1)-(X(n)-Y(n))|==MIN(n). for example, let's take an array: 2, 5, 7 then: first pair is {2, 5}, {7} ==> X(0)==2*5==10, Y(0)==7, MIN(0)==3; second is {2, 7}, {5} ==> X(0)==14, Y(0)==5, MIN(1)==6; third is ..
------------------------------------------------
Thanks a lot in Advance.

Last fiddled with by SarK0Y on 2010-03-08 at 00:01
SarK0Y is offline   Reply With Quote
Old 2010-03-08, 07:08   #2
lfm
 
lfm's Avatar
 
Jul 2006
Calgary

52×17 Posts
Default

Quote:
Originally Posted by SarK0Y View Post
Good Time to All, Amici.

i got following math problem: to split up number array into pairs of arrays where X[t] & Y[t] are multiplications of numbers of gotten arrays (in t'th pair) with condition: |X(0)-Y(0)|==MIN(0), |MIN(0)-(X(1)-Y(1))|==MIN(1), ..., |MIN(n-1)-(X(n)-Y(n))|==MIN(n). for example, let's take an array: 2, 5, 7 then: first pair is {2, 5}, {7} ==> X(0)==2*5==10, Y(0)==7, MIN(0)==3; second is {2, 7}, {5} ==> X(0)==14, Y(0)==5, MIN(1)==6; third is ..
------------------------------------------------
Thanks a lot in Advance.
Sorry, you haven't described what you mean by "t'th pair" yet. Without a more complete description of the problem there's not much we can do to help.
Your example doesn't match the description either, you seem to say X[t] and Y[t] are multiplications of pairs but your example the Y is not any multiplication of any pair.

You should call the MIN function something else. MIN is conventionally the MINIMUM function and will cause confusion.

Is this a school math problem? It should be in the homework help section. Not the main math section.
lfm is offline   Reply With Quote
Old 2010-03-08, 17:53   #3
SarK0Y
 
SarK0Y's Avatar
 
Jan 2010

10101102 Posts
Default

lfm
Quote:
you seem to say X[t] and Y[t] are multiplications of pairs but your example the Y is not any multiplication of any pair.
thanks for reply. "t" is index of array's pair, not number's pair, array with one item gives number itself. for example, another original array & possible array's pairs: {3, 11, 23, 31, 37} then possible array's pairs: {3, 11, 31}, {23, 37};... ; {3}, {11, 23, 31, 37}.
Quote:
Is this a school math problem?
no

Last fiddled with by SarK0Y on 2010-03-08 at 17:54
SarK0Y is offline   Reply With Quote
Old 2010-03-08, 21:08   #4
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

22·3·641 Posts
Default

Quote:
Originally Posted by SarK0Y View Post
for example, another original array & possible array's pairs: {3, 11, 23, 31, 37} then possible array's pairs: {3, 11, 31}, {23, 37};... ; {3}, {11, 23, 31, 37}.
From this example, it seems to me that you may be talking about set partitions ( http://mathworld.wolfram.com/SetPartition.html ).

I'm not sure how to translate all your other notations into terms I'm familiar with, but let me ask about some possibilities:

Start with same "original array" as in your example: {3, 11, 23, 31, 37}

Is that intended to be a well ordered set ( as in http://mathworld.wolfram.com/WellOrderedSet.html ) ?

One partition of that set is: {3, 11, 31}, {23, 37}.

Another partition of that set is: {3}, {11, 23, 31, 37}.

From the Mathworld entry for Bell number ( http://mathworld.wolfram.com/BellNumber.html ): "The number of ways a set of n elements can be partitioned into nonempty subsets is called a Bell number and is denoted Bn (not to be confused with the Bernoulli number, which is also commonly denoted Bn).

The number of partitions of a 5-element set such as {3, 11, 23, 31, 37} is 52, so there are 50 partitions besides the two you give as examples, {3, 11, 31},{23, 37} and {3},{11, 23, 31, 37}. (... except that your term "pair" may mean you're considering only the partitions that have exactly two subsets of the original set. See below.)

Does all this make sense? Am I correctly interpreting what you mean, SarK0Y?

Quote:
|X(0)-Y(0)|==MIN(0), |MIN(0)-(X(1)-Y(1))|==MIN(1), ..., |MIN(n-1)-(X(n)-Y(n))|==MIN(n). for example, let's take an array: 2, 5, 7 then: first pair is {2, 5}, {7} ==> X(0)==2*5==10, Y(0)==7, MIN(0)==3; second is {2, 7}, {5} ==> X(0)==14, Y(0)==5, MIN(1)==6; third is ..
_If_ my interpretation so far is correct, then for your 5-element example {3, 11, 23, 31, 37}, we have:

Suppose partition 0 is {{3, 11, 31}, {23, 37}}. Then

X(0) = 3*11*31 = 1023 and Y(0) = 23*37 = 851

and, using "M(n)" instead of "MIN(n)" to avoid confusion with the minimum function,

|X(0)-Y(0)|==M(0), so M(0) = |1023-851| = 172.

Okay so far?

In your 3-element example {2, 5, 7}, partition 0 ("first pair") is {{2, 5}, {7}} and partition 1 ("second pair") is {{2, 7}, {5}}.

Is the "third pair" (partition 2) = ({5, 7}, {2}} ?

Do you have any use for the partition {{2}, {7}, {5}}, or does your term "pair" mean you're considering only the partitions that have exactly two subsets of the original set?

How are you ordering the partitions? What determines which partition is "first pair" = partition 0?

Last fiddled with by cheesehead on 2010-03-08 at 21:43 Reason: tidying up
cheesehead is offline   Reply With Quote
Old 2010-03-08, 22:21   #5
axn
 
axn's Avatar
 
Jun 2003

508710 Posts
Default

Code:
N=2*5*7;
s=0;fordiv(N,x,if(x*x>=N,d=x-N/x;print(N/x, ",", x, " -> ", d, ":", d-s);s=d))

result:
7,10 -> 3:3
5,14 -> 9:6
2,35 -> 33:24
1,70 -> 69:36
axn is offline   Reply With Quote
Old 2010-03-09, 00:31   #6
SarK0Y
 
SarK0Y's Avatar
 
Jan 2010

1268 Posts
Default

Thanks for reply, Amici.
cheesehead
Bell numbers is more common task.
Quote:
|X(0)-Y(0)|==M(0), so M(0) = |1023-851| = 172... Is the "third pair" (partition 2) = ({5, 7}, {2}}
perfectly correct.
Quote:
Do you have any use for the partition {{2}, {7}, {5}}, or does your term "pair" mean you're considering only the partitions that have exactly two subsets of the original set?
you're right, original Set(array) must be splited up into two subsets on the each iteration.
Quote:
How are you ordering the partitions? What determines which partition is "first pair" = partition 0?
|X(0)-Y(0)|==M(0), |M(0)-(X(1)-Y(1))|==M(1),... , |M(n-1)-(X(n)-Y(n))|==M(n). M(t) is min value for current iteration.

Last fiddled with by SarK0Y on 2010-03-09 at 00:46
SarK0Y is offline   Reply With Quote
Old 2010-04-05, 15:29   #7
SarK0Y
 
SarK0Y's Avatar
 
Jan 2010

2×43 Posts
Default

i got M(0) with following algo:
//(given: set I with n integers)
sort(I); //I(0)<I(1)..<I(n-1)
int x=n-1, y=n-2;
for(int i=n-3; i>-1; i--)
{
if(x>y)y*=I(i);
else x*=I(i);
}
-------
suggestions about other iterations shall be very appreciated:-)
SarK0Y is offline   Reply With Quote
Old 2010-04-07, 10:54   #8
SarK0Y
 
SarK0Y's Avatar
 
Jan 2010

8610 Posts
Default

small correction: int x=M(n-1), y=M(n-2);
SarK0Y is offline   Reply With Quote
Reply

Thread Tools


All times are UTC. The time now is 23:31.


Fri Aug 6 23:31:47 UTC 2021 up 14 days, 18 hrs, 1 user, load averages: 4.20, 3.91, 3.95

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.