Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I've made this proc and it has 2 outputs




*

How do I fix that?

Some mathematical functions and also some (not so) inert functions are implemented as objects.
For example, Perm is used to represent permutations.

p :=Perm([2,3,1,5,4]);  # ==> disjoint cycles representation
        p:=(1,2,3)(4,5);
lprint(p);
Perm([[1, 2, 3], [4, 5]])
    
Perm acts as an inert function (like RootOf) but it's an object.
Is it possible to convert it into a true inert form such as PERM([[1, 2, 3], [4, 5]]) and so, being able to extract the arguments with op?  

In this specific case we may use
convert(p, disjcyc);
       [[1, 2, 3], [4, 5]]
    
but this is possible only because Perm has a convert export.
So, is it possible to obtain the arguments directly (without convert)?
This would be useful for other situations.

Hi there,

ist there any possibility to change the native look and feel of the gui? I use Arch-Linux. I've tried other java runtimes instead of the shipped. Maple works, but only with the awful look and feel :D

Thx :)

Heiko

We all know that Maple's Latex is not the best of Maple to say the least.

But this one is really strange. Maple prints a `1` for no apparant reason in the latex which makes it ugly. 

I wonder if Maplesoft still maintains its Latex conversion code at all?  So one can at least hope may be one day all of this will get fixed? Year after year, and Maple's Latex still not changed.  

If Mapesoft do not intend to make any changes in its Latex conversion software at all, it will be good if an official statement is made in this regards so that at least customers know.

sol:=dsolve((x-a)*(x-b)*diff(y(x),x)+k*(y(x)-a)*(y(x)-b) = 0,y(x)):
sol:=subs(_C1=C[1],sol);

y(x) = ((x-b)^(-k)*(x-a)^k*a*exp(a*k*C[1]-b*k*C[1])-(x-b)^(-k)*(x-a)^k*b*exp(a*k*C[1]-b*k*C[1])+b*((-x+b)/(-x+a))^(-k)*exp(a*k*C[1]-b*k*C[1])-b)/(-1+((-x+b)/(-x+a))^(-k)*exp(a*k*C[1]-b*k*C[1]))

latex(sol)

y \left( x \right) ={1 \left(  \left( x-b \right) ^{-k} \left( x-a
 \right) ^{k}a{{\rm e}^{akC_{{1}}-bkC_{{1}}}}- \left( x-b \right) ^{-k
} \left( x-a \right) ^{k}b{{\rm e}^{akC_{{1}}-bkC_{{1}}}}+b \left( {
\frac {-x+b}{-x+a}} \right) ^{-k}{{\rm e}^{akC_{{1}}-bkC_{{1}}}}-b

 \right)  \left( -1+ \left( {\frac {-x+b}{-x+a}} \right) ^{-k}{{\rm e}
^{akC_{{1}}-bkC_{{1}}}} \right) ^{-1}}

 

 

Download why_1_in_latex.mw

 

Why odetest sometimes fail to give 0  from odetest when simply using C[1] instead of _C1 as constant of integration?

I do not remember now if I asked about this before now. But for me as a user, this does not look right. I like to use C[1] instead of _C1 as the constant of integration as it looks better in Latex. I had no idea it will make a difference to odetest what the constant of integration symbol used is.

Is this a known issue? Do you consider this a bug? Maple 2019.1 on windows 10.

restart;

ode:= x^2*diff(y(x),x)+x*y(x)+sqrt(y(x)) = 0;

x^2*(diff(y(x), x))+x*y(x)+y(x)^(1/2) = 0

sol_1:=sqrt(y(x))=1/x+_C1/sqrt(x);
odetest(sol_1,ode)

y(x)^(1/2) = 1/x+_C1/x^(1/2)

0

sol_2:=subs(_C1=C[1],sol_1);
odetest(sol_2,ode); #why this now fails??

y(x)^(1/2) = 1/x+C[1]/x^(1/2)

-y(x)^(1/2)-y(x)^(1/2)*x^(1/2)*C[1]+x*y(x)

sol_3:=subs(C[1]=_C1,sol_2);
odetest(sol_3,ode)

y(x)^(1/2) = 1/x+_C1/x^(1/2)

0

 

Download why_odetest_fail.mw

I am trying to use the StringTools package to extract the URLs from the html file exported from Microsoft Edge when i wish to transfer these to another browser, in a text file without all of the nonsense I havent learnt yet.

I just want to trim the file name to set up a Boolean function to check it's update for the day and the output went crazy and decided to spoil my day again

 


 

``

restart

with(StringTools);

[Anagrams, AndMap, ApproximateSearch, ApproximateSearchAll, ArithmeticMean, Border, BorderArray, BorderLength, CamelCase, Capitalize, CaseJoin, CaseSplit, Center, Centre, Char, CharacterFrequencies, CharacterMap, Chomp, Chop, CommonPrefix, CommonSuffix, Compare, CompareCI, Compress, CountCharacterOccurrences, Decode, Delete, DeleteSpace, DifferencePositions, Drop, EditDistance, Encode, Entropy, Escape, Exchange, ExpandCharacterClass, ExpandTabs, Explode, Fence, Fibonacci, Fill, FirstFromLeft, FirstFromRight, FormatMessage, FormatTime, FromByteArray, Generate, GenerateIdentifier, Group, HammingDistance, HammingSearch, HammingSearchAll, Has, HasASCII, HasAlpha, HasAlphaNumeric, HasBinaryDigit, HasControlCharacter, HasDigit, HasGraphic, HasHexDigit, HasIdentifier, HasIdentifier1, HasLower, HasOctalDigit, HasPrintable, HasPunctuation, HasSpace, HasUpper, HasVowel, Hash, Implode, Indent, IndexOfCoincidence, Insert, Iota, IsASCII, IsAlpha, IsAlphaNumeric, IsAnagram, IsBalanced, IsBinaryDigit, IsConjugate, IsControlCharacter, IsDerangement, IsDigit, IsEodermdrome, IsGraphic, IsHexDigit, IsIdentifier, IsIdentifier1, IsLower, IsMonotonic, IsOctalDigit, IsPalindrome, IsPeriod, IsPermutation, IsPrefix, IsPrimitive, IsPrintable, IsPunctuation, IsSorted, IsSpace, IsSubSequence, IsSuffix, IsUpper, IsVowel, Join, Kasiski, LeftFold, LeftRecursivePathOrder, Length, LengthSplit, Levenshtein, LexOrder, LongestCommonSubSequence, LongestCommonSubString, LowerCase, LyndonFactors, Map, MatchFence, MaxChar, MaximalPalindromicSubstring, Metaphone, MinChar, MinimumConjugate, MonotonicFactors, NGrams, NthWord, OrMap, Ord, OtherCase, Overlap, PadLeft, PadRight, ParseTime, PatternCanonicalForm, PatternDictionary, PatternEquivalent, Period, Permute, PrefixDistance, PrimitiveRoot, Random, Randomize, Readability, RegMatch, RegSplit, RegSub, RegSubs, Remove, Repeat, Repeats, RevLexOrder, Reverse, RightFold, RightRecursivePathOrder, Rotate, Search, SearchAll, Select, SelectRemove, Sentences, Shift, ShortLexOrder, ShortRevLexOrder, SimilarityCoefficient, Snarf, Sort, SortPermutation, Soundex, Split, Squeeze, Stem, StringBuffer, StringSplit, SubString, Substitute, SubstituteAll, SuffixDistance, Support, SyllableLength, Tabulate, Take, ThueMorse, ToByteArray, Trim, TrimLeft, TrimRight, Uncompress, Unique, UpperCase, Visible, WildcardMatch, WordContaining, WordCount, WordEnd, WordStart, Words, WrapText]

(1)

currentdir("G:\\Computer Science\\EDGE\\fav_exports"):

if is(currentdir() = "G:\\Computer Science\\EDGE\\fav_exports") = true then "Edge favorites usb import html directory is the current file path" end if;

"Edge favorites usb import html directory is the current file path"

(2)

Filename0 := ListDirectory(currentdir())[]

"Microsoft_Edge_‎08_‎29_‎2019.html"

(3)

StringTools['Reverse']("Microsoft_Edge_‎08_‎29_‎2019.html")

"lmth.9102���_92���_80���_egdE_tfosorciM"

(4)

Delete(Delete(Filename0, 1 .. 15), nops(Delete(Filename0, 1 .. 14))-4 .. nops(Delete(Filename0, 1 .. 14)))

Error, (in StringTools:-Delete) invalid range

 

dt := ParseTime("%Y-%m-%d", "2002-11-05")

dt:-year, dt:-month, dt:-monthDay

2002, 11, 5

(5)

``

``


 

Download microsoft_edge_fav_import_fail.mw
 

Edit: I have gotten closer with the following:

 


 

``

restart

with(StringTools);

[Anagrams, AndMap, ApproximateSearch, ApproximateSearchAll, ArithmeticMean, Border, BorderArray, BorderLength, CamelCase, Capitalize, CaseJoin, CaseSplit, Center, Centre, Char, CharacterFrequencies, CharacterMap, Chomp, Chop, CommonPrefix, CommonSuffix, Compare, CompareCI, Compress, CountCharacterOccurrences, Decode, Delete, DeleteSpace, DifferencePositions, Drop, EditDistance, Encode, Entropy, Escape, Exchange, ExpandCharacterClass, ExpandTabs, Explode, Fence, Fibonacci, Fill, FirstFromLeft, FirstFromRight, FormatMessage, FormatTime, FromByteArray, Generate, GenerateIdentifier, Group, HammingDistance, HammingSearch, HammingSearchAll, Has, HasASCII, HasAlpha, HasAlphaNumeric, HasBinaryDigit, HasControlCharacter, HasDigit, HasGraphic, HasHexDigit, HasIdentifier, HasIdentifier1, HasLower, HasOctalDigit, HasPrintable, HasPunctuation, HasSpace, HasUpper, HasVowel, Hash, Implode, Indent, IndexOfCoincidence, Insert, Iota, IsASCII, IsAlpha, IsAlphaNumeric, IsAnagram, IsBalanced, IsBinaryDigit, IsConjugate, IsControlCharacter, IsDerangement, IsDigit, IsEodermdrome, IsGraphic, IsHexDigit, IsIdentifier, IsIdentifier1, IsLower, IsMonotonic, IsOctalDigit, IsPalindrome, IsPeriod, IsPermutation, IsPrefix, IsPrimitive, IsPrintable, IsPunctuation, IsSorted, IsSpace, IsSubSequence, IsSuffix, IsUpper, IsVowel, Join, Kasiski, LeftFold, LeftRecursivePathOrder, Length, LengthSplit, Levenshtein, LexOrder, LongestCommonSubSequence, LongestCommonSubString, LowerCase, LyndonFactors, Map, MatchFence, MaxChar, MaximalPalindromicSubstring, Metaphone, MinChar, MinimumConjugate, MonotonicFactors, NGrams, NthWord, OrMap, Ord, OtherCase, Overlap, PadLeft, PadRight, ParseTime, PatternCanonicalForm, PatternDictionary, PatternEquivalent, Period, Permute, PrefixDistance, PrimitiveRoot, Random, Randomize, Readability, RegMatch, RegSplit, RegSub, RegSubs, Remove, Repeat, Repeats, RevLexOrder, Reverse, RightFold, RightRecursivePathOrder, Rotate, Search, SearchAll, Select, SelectRemove, Sentences, Shift, ShortLexOrder, ShortRevLexOrder, SimilarityCoefficient, Snarf, Sort, SortPermutation, Soundex, Split, Squeeze, Stem, StringBuffer, StringSplit, SubString, Substitute, SubstituteAll, SuffixDistance, Support, SyllableLength, Tabulate, Take, ThueMorse, ToByteArray, Trim, TrimLeft, TrimRight, Uncompress, Unique, UpperCase, Visible, WildcardMatch, WordContaining, WordCount, WordEnd, WordStart, Words, WrapText]

(1)

currentdir("G:\\Computer Science\\EDGE\\fav_exports"):

if is(currentdir() = "G:\\Computer Science\\EDGE\\fav_exports") = true then "Edge favorites usb import html directory is the current file path" end if;

"Edge favorites usb import html directory is the current file path"

(2)

Filename0 := ListDirectory(currentdir())[]

"Microsoft_Edge_‎08_‎29_‎2019.html"

(3)

StringTools['Reverse']("Microsoft_Edge_‎08_‎29_‎2019.html")

"lmth.9102���_92���_80���_egdE_tfosorciM"

(4)

Filename1 := StringTools:-Delete(Filename0, 1 .. nops(StringTools:-Explode(Filename0))-15)

"29_‎2019.html"

(5)

StringTools:-Delete(Filename1, nops(StringTools:-Explode(Filename1))-4 .. nops(StringTools:-Explode(Filename1)))

"29_‎2019"

(6)

StringTools:-Delete(StringTools:-Delete(Filename0, 1 .. nops(Filename0)), nops(StringTools:-Delete(Filename0, 1 .. nops(Filename0)))-4 .. nops(StringTools:-Delete(Filename0, 1 .. 10)))

Error, (in StringTools:-Delete) invalid range

 

dt := ParseTime("%Y-%m-%d", "2002-11-05")

dt:-year, dt:-month, dt:-monthDay

2002, 11, 5

(7)

``

``


 

Download microsoft_edge_fav_import_fail2.mw

 

Hi,

In statistics a  "degree of freedom" is a strictly positive integer.

The three distributions ChiSquare, StudentT and FRatio from package Statistics have degrees of freedom as parameters. Nevertheless they accept any strictly positive real values for them.
(one can verify that their "Conditions" attribute is of the form [0 < n] instead of [n::posint]).

I think this ought to be corrected in future versions
 

A=B  but not able to simplify arctanh(A)-arctanh(B)  to be zero.  Why? Is there a workaround? Using Maple 2019.1

restart;

A:=((y*sqrt(3) + 3)*sqrt(3))/(6*sqrt(y^2 + 1));
B:=(y + sqrt(3))/(2*sqrt(y^2 + 1));
simplify(A-B)

(1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2)

(1/2)*(y+3^(1/2))/(y^2+1)^(1/2)

0

simplify(arctanh(A)-arctanh(B))

arctanh((1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2))-arctanh((1/2)*(y+3^(1/2))/(y^2+1)^(1/2))

simplify(arctanh(A)-arctanh(B),trig)

arctanh((1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2))-arctanh((1/2)*(y+3^(1/2))/(y^2+1)^(1/2))

simplify(arctanh(A)-arctanh(B)) assuming positive

arctanh((1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2))-arctanh((1/2)*(y+3^(1/2))/(y^2+1)^(1/2))

simplify(arctanh(A)-arctanh(B),trig) assuming positive

arctanh((1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2))-arctanh((1/2)*(y+3^(1/2))/(y^2+1)^(1/2))

plot(arctanh(A),y=-Pi..Pi)

plot(arctanh(B),y=-Pi..Pi)

 

 

Download will_not_simplify.mw

Compare to Mathematica:

Dear Users!
Hope you all are fine with everything. How we can identify the same equations from a number of equations using maple command, like
Eq1:=5.09295817894067*`&tau;u`[1, 1]-30.5577490736439*`&tau;u`[2, 1]+178.253536262923*`&tau;u`[3, 1]-30.5577490736439*`&tau;u`[1, 2]+183.346494441862*`&tau;u`[2, 2]-1069.52121757753*`&tau;u`[3, 2]+178.253536262923*`&tau;u`[1, 3]-1069.52121757753*`&tau;u`[2, 3]+6238.87376920228*`&tau;u`[3, 3];
Eq2:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]-30.5577490736439*`&tau;u`[1, 2]-61.1154981472883*`&tau;u`[2, 2]-91.6732472209439*`&tau;u`[3, 2]+178.253536262923*`&tau;u`[1, 3]+356.507072525849*`&tau;u`[2, 3]+534.760608788841*`&tau;u`[3, 3]-3/7;
Eq3:=5.09295817894067*`&tau;u`[1, 1]-30.5577490736439*`&tau;u`[2, 1]+178.253536262923*`&tau;u`[3, 1]+10.1859163578814*`&tau;u`[1, 2]-61.1154981472883*`&tau;u`[2, 2]+356.507072525849*`&tau;u`[3, 2]+15.2788745368241*`&tau;u`[1, 3]-91.6732472209439*`&tau;u`[2, 3]+534.760608788841*`&tau;u`[3, 3]-9/7;
Eq4:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]+10.1859163578814*`&tau;u`[1, 2]+20.3718327157631*`&tau;u`[2, 2]+30.5577490736484*`&tau;u`[3, 2]+15.2788745368241*`&tau;u`[1, 3]+30.5577490736484*`&tau;u`[2, 3]+45.8366236104784*`&tau;u`[3, 3]-12/7;
Eq5:=5.09295817894067*`&tau;u`[1, 1]-30.5577490736439*`&tau;u`[2, 1]+178.253536262923*`&tau;u`[3, 1]+50.9295817894067*`&tau;u`[1, 2]-305.577490736439*`&tau;u`[2, 2]+1782.53536262923*`&tau;u`[3, 2]+504.202859715131*`&tau;u`[1, 3]-3025.21715829077*`&tau;u`[2, 3]+17647.1000900295*`&tau;u`[3, 3]-18/7;
Eq6:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]+50.9295817894067*`&tau;u`[1, 2]+101.859163578814*`&tau;u`[2, 2]+152.788745368241*`&tau;u`[3, 2]+504.202859715131*`&tau;u`[1, 3]+1008.40571943027*`&tau;u`[2, 3]+1512.60857914560*`&tau;u`[3, 3]-3;
Eq7:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]-30.5577490736439*`&tau;u`[1, 2]-61.1154981472883*`&tau;u`[2, 2]-91.6732472209439*`&tau;u`[3, 2]+178.253536262923*`&tau;u`[1, 3]+356.507072525849*`&tau;u`[2, 3]+534.760608788841*`&tau;u`[3, 3]-3/7;
Eq8:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]+10.1859163578814*`&tau;u`[1, 2]+20.3718327157631*`&tau;u`[2, 2]+30.5577490736484*`&tau;u`[3, 2]+15.2788745368241*`&tau;u`[1, 3]+30.5577490736484*`&tau;u`[2, 3]+45.8366236104784*`&tau;u`[3, 3]-12/7;
Eq9:=41.7622570673196*`&tau;u`[3, 1]+41.7622570673196*`&tau;u`[1, 3]+15.2788745368220*`&tau;u`[1, 1]+83.5245141346398*`&tau;u`[2, 3]+30.5577490736443*`&tau;u`[2, 1]+113.063671572516*`&tau;u`[3, 3]+83.5245141346398*`&tau;u`[3, 2]+30.5577490736443*`&tau;u`[1, 2]+61.1154981472892*`&tau;u`[2, 2];
In above equations Eq2 and Eq7; Eq4 and Eq8 are same. If I have set of 100 equation how I can identify similar equations?
@acer @Kitonum @Preben Alsholm

The uploaded worksheet describes a mechanics scenario which I would like to animate.

While I understand the expression for the kinetic energy of the torus, the term containing cos(theta) within the expression for the KE of the pearl baffles me.

From which physics aspect of the scenario does this term derive?

Pearl_in_torus.mw

Hi, 

While trying to convert into integers a sample S drawn from a binomial distribution,  I've observed that  round~(S) didn't do the job while map(round, S) did it.

First question: why the first syntax and the second one are not equivalent on this case?

I investigated a little bit further by applying round~ on a row vector T of Hfloats (thus T and S are "identical")

Second question: While  round~(S) doesn't work but round~(T) does?


 

restart

S := Statistics:-Sample(Binomial(10, 0.5), 2);
round~(S);      # Why round~(S) doesn't return integers
map(round, S);  # but map(round, S) does?

lprint(S)

S := Vector[row](2, {(1) = 6.0, (2) = 7.0}, datatype = float[8])

 

Vector[row]([6., 7.])

 

Vector[row]([6, 7])

 

Vector[row](2, {1 = HFloat(6.), 2 = HFloat(7.)}, datatype = float[8], storage = rectangular, order = Fortran_order, shape = [])

 

# Evaluation of round~(T) on a vector of Hfloats



T := Vector[row](2, [HFloat(6.), HFloat(3.)]);
lprint(S);
round~(T);   # round~(T) returns integers,
             

T := Vector[row](2, {(1) = HFloat(6.0), (2) = HFloat(3.0)})

 

Vector[row](2, {1 = HFloat(6.), 2 = HFloat(7.)}, datatype = float[8], storage = rectangular, order = Fortran_order, shape = [])

 

Vector[row]([6, 3])

(1)

 


 

Download Tilde_versus_map.mw

 

Hello, 

In this simple example in Maple 2019:

 

k[1] := 16;

solve(k[2]^2 = k[1], {k[2]}, useassumptions) assuming 0 < k;
 

The result of the solve is 

{k[2] = 4}, {k[2] = -4}

which is not what I'm expecting.

I'm expecting 

{k[2] = 4}

I'm trying to assume that both the variable named k[1] and the variable named k[2] are greater than 0 by assuming that 0 < k.
My goal is a way to make the same assumption for variables with the same base but different subscripts.
How can I do this?

Thanks in advance.


 

``

  Note: To enter units, I used the unit key (blue) in the Units palette.

  When I use the combine and simplify functions to manipulate temperature units, Maple returns a wrong answer, as we can see below;

combine(20*Unit(Unit('Celsius'))+30*Unit('K'), units)

50*Units:-Unit(K)

(1)

simplify(20*Unit(Unit('Celsius'))+30*Unit('K'))

50*Units:-Unit(K)

(2)

  The quantity 20 Celsius is not converted correctly. However, for other types of dimensions, the combine and simplify functions work correctly.

combine(10*Unit('m')+120*Unit('cm')+200*Unit('ft'), units)

(1804/25)*Units:-Unit(m)

(3)

simplify(10*Unit('m')+120*Unit('cm')+200*Unit('ft'))

(1804/25)*Units:-Unit(m)

(4)

``

Another strange thing happens with the convert function, with temperature units. When we use the same source unit, the convert function deletes the unit, leaving only the quantity.

convert(30*Unit('K'), temperature, Unit('K'))

30

(5)

 I do not understand why this occurs.

convert(10*Unit('m'), units, Unit('m'))

10*Units:-Unit(m)

(6)

I do not understand why this occurs.

 

Oliveira


 

Download Matching_units.mw

If I copy the output of a lprint command e.g.
lprint(<1,2;3,4>);

Matrix(2,2,{(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4},datatype = anything
,storage = rectangular,order = Fortran_order,shape = [])

and paste it in a new execution group, I obtain a "Line print output" instead of a Maple (1D) input,
so it cannot be executed.
(Of course, it's possible to paste in Notepad to remove the format, but it's annoying.)

This happens in Maple 2019,  Windows 64, Worksheet mode, 1D input;  but not all the time (sometimes it is as it used to be).
Do you see the same behavior?

 

Maple doesn't completely check the condition on the number of trials "n" for Binomial and NegativeBinomial distributions (package Statistics).
The attribute "Conditions" explicitely says that n must be a strictly positive integer but no strictly positive real valuereturna an error (ok, it would be stupid to set n to a non integer value !!!).

I think it is a default that ought to be corrected in future releases (this default still exists in Maple 2018)

 

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

with(Statistics):


BINOMIAL DISTRIBUTION

X := RandomVariable(Binomial(n, p)):
L := [attributes(X)][3]:
A := exports(L)

Conditions, ParentName, Parameters, CDF, CharacteristicFunction, Kurtosis, Mean, Median, Mode, MGF, ProbabilityFunction, Skewness, Support, Variance, VariationCoefficient, CDFNumeric, QuantileNumeric, RandomSample, RandomSampleSetup, RandomVariate

(2)

L:-Conditions

[0 <= p, p <= 1, n::posint]

(3)

# Maple should return an error for N is not of type posint
#
# It seems that Sample uses floor(N)

N := 10.49; type(N::posint);
P := 1/2:
X := RandomVariable(Binomial(N, P)):
Mean(X), N*P;
ProbabilityFunction(X, k);
S := Sample(X, 10^6):
Mean(S);


# A non consistent result (only non negative values of k should be accepted)

eval(ProbabilityFunction(X, k), k=evalf(Pi));

N := 10.49

 

false

 

5.245000000, 5.245000000

 

piecewise(k < 0, 0, binomial(10.49, k)*(1/2)^k*(1/2)^(10.49-k))

 

HFloat(4.998903)

 

.1096019539

(4)


NEGATIVE BINOMIAL DISTRIBUTION

X := RandomVariable(NegativeBinomial(n, p)):
L := [attributes(X)][3]:
A := exports(L):
L:-Conditions

[0 < n, 0 < p, p <= 1]

(5)

N := 10.49:
P := 1/2:
X := RandomVariable(NegativeBinomial(N, P)):

Mean(X)


 

Download BinomialLaw.mw

 

5 6 7 8 9 10 11 Last Page 7 of 1582