Carl Love

Carl Love

28110 Reputation

25 Badges

13 years, 120 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

Why do you want to use C when those things can be done in Maple?

Do you mean that p is the conjugate of z?

@brian bovril To change the prompt, use interface(prompt= "(**)").

Where is my sequence wrong? I tested it up to the 1000th Fibonacci.

@brian bovril To change the prompt, use interface(prompt= "(**)").

Where is my sequence wrong? I tested it up to the 1000th Fibonacci.

@wolfman29 Yes, you can do double (and higher dimension) numeric integrals. There are basically two syntaxes:

Int(Int(x^2+y^2, x= 0..y), y= 0..1);  evalf(%);

or

Int(x^2+y^2, [x= 0..y, y= 0..1]);  evalf(%);

@wolfman29 Yes, you can do double (and higher dimension) numeric integrals. There are basically two syntaxes:

Int(Int(x^2+y^2, x= 0..y), y= 0..1);  evalf(%);

or

Int(x^2+y^2, [x= 0..y, y= 0..1]);  evalf(%);

Why do you say "possible"? It's clear to me that your code covers all the cases.

Why do you say "possible"? It's clear to me that your code covers all the cases.

First, let's clarify what the problem under discussion is. I see two possibilities:

  1. to find any group of coins whose total value exceeds $1 but such that no subset makes exactly $1,
  2. to find a group of coins of maximal total value satisfying (1).

Problem (1) feels like a "knapsack problem". (See the Wikipedia arcticle "Knapsack problem".) I am not at all sure about that. The subset sum problem is a relatively easy (NP-complete) case of the knapsack problem (NP-hard). Problem (2) feels like something where you'd have to solve a knapsack problem for each point (coin combination) that you're checking.

We must resort to heuristics. The best heuristic that I've ever learned applies here, and it applies to almost any real-world packing job: "Put the big ones in first". That's what you've done in your informal solution to this problem: You put in the 50-cent piece, then the 20s, then decided you couldn't fit any 10s, then put in the 5.

 

 

@abbeykabir The two curves are so close that the difference is not perceivable. You can find the maximum difference between them with the command

LinearAlgebra:-Norm(M[.., 2] - M[.., 3]);

To exchange the horizontal and vertical axes, change M[.., [1,2]] to M[.., [2,1]] and likewise for M[.., [1,3]].

As threads get older, it gets harder and harder to find them. If you have more questions, please make a new thread.

@abbeykabir The two curves are so close that the difference is not perceivable. You can find the maximum difference between them with the command

LinearAlgebra:-Norm(M[.., 2] - M[.., 3]);

To exchange the horizontal and vertical axes, change M[.., [1,2]] to M[.., [2,1]] and likewise for M[.., [1,3]].

As threads get older, it gets harder and harder to find them. If you have more questions, please make a new thread.

@Alejandro Jakubi 

But the second part of my example shows that assuming is not following this design principle (also from ?assuming,details ):

The output is the same as that received by successively doing the following.
  1. Calling assume (to enter assumptions on names).
  2. Entering (and so evaluating under the assumptions) the expression depending on these names.
  3. Removing the assumptions.

The example shows that it is possible to make the assumptions effectively without scanning the procedure.

 

 

@Alejandro Jakubi 

But the second part of my example shows that assuming is not following this design principle (also from ?assuming,details ):

The output is the same as that received by successively doing the following.
  1. Calling assume (to enter assumptions on names).
  2. Entering (and so evaluating under the assumptions) the expression depending on these names.
  3. Removing the assumptions.

The example shows that it is possible to make the assumptions effectively without scanning the procedure.

 

 

@abbeykabir 

Use option linestyle to the plot command:

plot(
     [M[.., [1,2]], M[.., [1,3]]],
     labels= [time, `error`], legend= [error1, error2],
     linestyle= [dash, dashdot]
);

The possible values for linestyle are solid, dot, dash, dashdot, longdash, spacedash, and spacedot. See ?plot,options .

@abbeykabir 

Use option linestyle to the plot command:

plot(
     [M[.., [1,2]], M[.., [1,3]]],
     labels= [time, `error`], legend= [error1, error2],
     linestyle= [dash, dashdot]
);

The possible values for linestyle are solid, dot, dash, dashdot, longdash, spacedash, and spacedot. See ?plot,options .

First 612 613 614 615 616 617 618 Last Page 614 of 710