Carl Love

Carl Love

28150 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@vv Your solution leads to the very unusual situation that the definition of a module procedure depends on a global variable and if that global variable changes---even after the module is loaded---then the module export will change. It's not a bug per se, but I think that it's bug prone.

@vv But the divisors of a^b can be easily determined from the divisors of a.

@taro You should think of LL as a matrix which contains only the z-values. So, there are 12 z-values laid out in a 3 x 4 grid.

@Mitterrand Perhaps there is a bug with the limits in your version of Maple which has subsequently been corrected? If I re-execute your worksheet, I don't get 0. I get the same result as shown by Kitonum below.

@Kitonum Why gpwr:= gpwr*(g mod p) rather than the original gpwr:= gpwr*g mod p? I think that the original is correct.

@Jjjones98 It is common for respondents on MaplePrimes to end their example commands with semicolons because that used to be required for single-command input. These terminal semicolons are not parts of the commands and are not meant to be included when those commands are used as subexpressions in other expressions. So, remove the internal semicolon.

@Jjjones98 But vv's S is a procedure, not a direct command.

@Kitonum I didn't mean to give the impression that one couldn't animate a plot3d. However, it was pretty clear to me that the OP wanted a 2D animation. This is afterall the equation of a wave moving through a one-dimensional object, a string.

@st0812 You can export a Maple worksheets as a PDF. Use "Export as" from the File menu. This will include the code, text, results, and graphics, and it'll be viewable by anyone, regardless of whether they have Maple.

@st0812 To animate that, change plot3d to plot.

@rstellian Here's another way, which I like better because it makes it clear that you're trying to pad x with leading zeros so that it's the same length as X:

scm:= (X::posint, x::posint)-> nprintf("%0*d", length(X), x):

Also, I changed ilog10 to length in the Answer above.

@Preben Alsholm The button only appears on posts (questions, answers, replies) that have no responses and whose authors have 10 or fewer reputation points. It has always been that way, ever since the spam button has existed.

You wouldn't do this with nested if statements. Every practical computer language (above the level of assembler) has a looping command that increments an index variable (i in your case) for each pass through the loop. That command in Maple is for, as used in John Fredsted's Answer below.

To directly answer the question that you pose in your title: Yes, that has happened to me a few times. I can't recall how it got fixed, but it did.

You should upload your worksheet as a file attachment rather than as a screenshot. To do that, use the green uparrow on the toolbar in the MaplePrimes editor.

@weidade37211 If R is your random variable, try Statistics:-DensityPlot(R) (*footnote). That'll give you a plot of vertical columns whose heights are the probabilities and whose horizontal coordinates are the "support" (i.e., data values). If that's not what you want, let me know.

The plot command that you suggest doesn't work very well because the ProbabilityFunction is only nonzero at discrete values (which plot won't be able to deduce because it's discontinuous). But ultimately it can be done with plot using some finesse to get exactly what you want.

*footnote: Although "density" is used in the command's name, it actually uses either the PDF or the ProbabilityFunction, whichever is appropriate. The needed information is stored in the module that encodes the random variable.

First 346 347 348 349 350 351 352 Last Page 348 of 711