Carl Love

Carl Love

28035 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@vs140580 
It returns true if and only if

  • for every row R1 of A there exists a row R2 of such that R1 "equals" R2 using the definition of equality of rows that you gave

        AND

  • for every row R2 of B there exists a row R1 of A such that R1 "equals" R2 using the definition of equality of rows that you gave;

otherwise, it returns false.  

@angelisasking I don't know HPM well enough to provide much help. I looked at your worksheet, and I wonder why you think that there's something wrong with it? The differences seem quite small compared to the magnitudes of the functions being approximated. In other words, what we call the relative error (|true value minus approximate value|/|true value|) is small, especially considering that you're using series of very low degree (4).

On the other hand, perhaps there is something wrong with your worksheet that would be obvious to someone who knows HPM which I missed.

A reasonable test of the accuracy would be to increase the number of terms in the series and see if the error gets smaller.

@MANUTTM What do the independent variables ySr, and g represent? I'm puzzled by the recent appearance of g, which seems to be an independent variable of D (demand) only? Do you have a way to compute D(g, Sr) for any feasible g and Sr

@wswain You wrote:

  • I am not sure why when I tried to change the execution group to Maple Input (with F5 and by the pull down) and it kept responding as in 2-D mode even though it said "maple input" in the bar.

I've noticed that myself in Maple 2022. I don't know whether it's a bug or it's supposed to work that way; nor do I know when, if ever, that changed.

@acer Thank you. When I checked, it was listed (with dead links) in Recent Posts and Active Conversations, but not in Recent Questions. It seems to take an inordinate amount of time for that update to happen.

@Rouben Rostamian  Although what you posted is not a complete Answer, it's almost an Answer, and it's all in the right direction towards getting a complete Answer. So, your significant quantity of work is appreciated and deserves a vote up.

@vv Amazing, but how did you find and its argument? 

Why are you using a finite-difference derivative approximation? And with such a large value of delta (0.01) at that? If there's some reason why you can't use a regular derivative, that may explain why fsolve is not working. fsolve might work with a lower value of Digits, say 5 or 6. The default in Maple is Digits = 10, so there's a good chance that's also the default in Maple Flow.

@mmcdara In Maple 2022, I tried your Student[Statistics]:-Sample command and numerous variations. They either returned hfloat results identical to Statistics:-Sample, meaningless results (e.g., when using Binomial(100, 3/10)), or some indication that the input wasn't understood (e.g., when using BinomialRandomVariable(100, 0.3)).

It would be nice if there was a nicer way than trunc to get Sample to return integers for integer distributions.

@pointerbender As to the reason that it helps, note that vv's idea is a standard trick for proving summation formulas by mathematical induction. As in
 

restart:

#Use mathematical induction to prove this:
S:= n-> Sum(k, k= 1..n) = n*(n+1)/2:
S(n);

Sum(k, k = 1 .. n) = (1/2)*n*(n+1)

#Base case:
S(1);

Sum(k, k = 1 .. 1) = 1

#Inductive case:
S(n+1) - S(n) = n+1;

(Sum(k, k = 1 .. n+1)-(Sum(k, k = 1 .. n)) = (1/2)*(n+1)*(n+2)-(1/2)*n*(n+1)) = n+1

simplify(%);

(Sum(k, k = n+1 .. n+1) = n+1) = n+1

 

Download SumInduction.mw

Note that I've only used the inert command Sum rather than its active form sum. So the proof is making no use of the fact that Maple's sum already knows the formula that we're trying to prove, which of course wouldn't be fair.

So that your Question can be better Answered, please clarify these things:

  1. Your example problem is so trivial that I'm having trouble answering it partly because there are so many ways to code it (most of which don't use recursion) and partly because it's hard to understand why anyone would want a recursive solution for something that can be completely solved with a very simple equation (x[i] = x[0] + i*b). I suspect that the other two respondents have similar thoughts. So, if this was just intended to be a simple example of a more-general problem that is your actual interest, then please give a more-relevant example.
     
  2. What do you mean by "binary" in the title? Yes, I know what binary means, but I can't see how it applies to your example. Perhaps if that were explained, the example wouldn't seem so trivial.
     
  3. Reading what you wrote as standard mathematical English, it seems that you want to restrict the solutions to a particular set A. That's not possible if your other mathematical symbols are meant in their usual interpretations. (Thus, the other two respondents assumed that you meant that you want the output sequence as a set, without restriction.) So, what did you really mean by the set A? The restriction to a given set is not possible because once a value is given for b and any single x[i], the rest are completely determined by your formula x[i] = x[i-1] + b.

@ecterrab It is not "an entirely different problem". In both cases, an anomaly occurs because the input expression can be simplified to 0. Whether that occurs inside of a RootOf is of minor significance. I wanted to present an example that would give problematic results without an error message[*1], so I intentionally chose one where RootOf wouldn't be involved.

[*1] ...because bugs that are manifested without throwing an error are much more dangerous and insidious.

@acer Here's a similar but simpler case with problematic (IMO) results. I prefer the solve result.

PDEtools:-Solve(sin(t)^2 + cos(t)^2 - 1, t); #NULL output 
solve(sin(t)^2 + cos(t)^2 - 1, t);
                               
t

You wrote: 

  • Will the above work all the time? should this command be used to obtain this information or is there a better way?

You need to reread carefully your posted output of your own commands, because they didn't even work on the example that you showed. The extremal values of the second coordinate do not necessarily correspond to the extremal values of the first coordinate. However, extracting the min and max (rather than the first and last) of each column of the data matrix is a viable strategy for obtaining the "true view"---one that I've used myself to get around that DEFAULT problem (long before the "originalview" field was introduced).

@angelisasking I think that all that you need to do is change the i on the right side of the line of code that I indicated to some other otherwise-unused variable.

First 82 83 84 85 86 87 88 Last Page 84 of 708