Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 361 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

This is known as the optimization version of the partition problem. It is known to be NP-hard. (See the Wikipedia article "Partition problem", especially the second paragraph.) It is usually formulated like this:

Given a list (or multiset) of positive integers, find a partition into two sublists such that the absolute value of the difference of the sums of the sublists is minimized.

I've thought about this problem (very casually) for several decades because of the following application, which used to be practical, but is somewhat obsolete now due to advances in audio playback technology. 

Problem/Application: You have a group of recordings of songs of varying lengths that you want to place onto both sides of a compact cassette tape. You can cut the tape to any length, but the length of the two sides is necessarily the same. You want to minimize the amount of blank (no music) time because it is annoying to have that silence while you're waiting for the tape player to switch to the other side.

@rlewis 

Have you clicked to "play" the animation? There is no way to do this programmatically; it must be selected by mouse by the end user. There are two ways (in the Standard GUI):

1. Right click on the plot to bring up the context menu. Select Animation, then Play.

2. Left click on the plot to select it. The animation controls will appear in the toolbar. The third tool from the left is the "play". It's a yellow triangle pointing right.

@tobbie247 

I don't know these methods. But it is clear that the numbers that you give are not solutions to the problem at hand:

Eqs:= [
     limit(numapprox:-pade(diff(f,x), x, [4,4]), x= infinity) - 1,
     limit(numapprox:-pade(t, x, [4,4]), x= infinity)
]:
eval(Eqs, [A= 0.742408087440, B= 0.943866213084]);

     [12.1675708991394, 1.28648179604728]

If the given A and B had been solutions, the returned numbers would be close to 0.

Perhaps if you present the original problem, someone here can try to solve it.

@Feenix 

My real name is Carl James Love.

@acer Acer,

After issuing the command readlib(realroot) (in Maple 16 or earlier, of course), is there some way to list all of the global names that are newly defined as a result of that command? In this case, that list would include zero_onepolyvariations, and midpoint.

@Carl Love 

Where does the procedure zero_one come from? It is not defined explicitly in your code proving1.txt. After running the code in Maple 16, this procedure exists. After running the code in later Maple, the procedure does not exist. The absence of this procedure is the reason for the error.

@Feenix Thanks. That's what I needed. So far I've been able to confirm what you report: The program works in Maple 16 and errors out in any later Maple.

@Feenix 

Regardless, I'm still willing to help you debug this. And I'm sure that the Maplesoft people will be interested in an example of some code that works in Maple 16 but not in Maple 2015. But you still haven't answered the fundamental question---the first step in debugging: What is the call, the invocation, that gives you the error message??? How about attaching a worksheet that shows what you do to get the error message?

@2ndeay 

Does this thread from yesterday answer your question? If not, please post your question as a new Question and include whatever code you have.

@Rouben Rostamian  Thanks for the explanation, Rouben. Like I suspected, it's what I call "normalized". To me, some examples of dimensionless measures are interest rates and half-lives.

@Oloyemike 

Like I said, I don't really understand the mathematics behind this, so my comments maybe irrelevant. It looks to me like you have three independent variables: rx, and tau. If so, you need to find some other software to numerically solve this; Maple currently only handles two.

Also, the phrases "dimensionless time", "dimensionless radius", "dimensionless concentration", and "dimensionless axial distance" all seem to be nonsense to me. I am very open to someone else explaining to me why they aren't nonsense. AFAIK, time and distance are by definition dimensions. Perhaps by "dimensionless" you simply mean that these quantities have been "normalized" to a zero-to-one scale. 

Tom,

I figured out how to put the parentheses to duplicate the OP's numeric results. I broke it down into subexpressions so that it's easier to see what's going on.

sigma:= 8/sqrt(2*Pi);
i:= 151;
E:= j-> 2^i*exp(-j^2/(2*sigma^2));
R:= j-> round(E(j));
evalf(log[2](-(sum(log(R(j)/E(j))*R(j)/2^i, j= 0..7))));

 

@tomleslie You're not missing anything; I got the same thing. I didn't need to run the code to Answer this because it's such a common Question. But, now that you've brought it up, I'd like to see the OP's correction of the parentheses, because I also can't get what they claim to get. 

@Feenix 

You are being very difficult and frustrating! Why? Don't you want help? Please type precisely what you enter into Maple to get an error message. Something like

findproot(x^2 + y^2 + z^2 - x*y - y*z - z*x, x, 1);

If it's a higher-level procedure where you enter something to get the error in findproot, then give us that higher-level command!

You speak as if you wrote this 6000-line Maple program, yet you don't know the first thing about debugging? It's a little hard to believe.

@Feenix 

And we need the call---the fvar,and k for which you get the error. 

First 477 478 479 480 481 482 483 Last Page 479 of 709