Robert Israel

6577 Reputation

21 Badges

18 years, 218 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

Interesting: the expected number of repetitions of length 7 in 10000 random digits is approximately 5, so this is a bit low, though not unusually low.

The problem with a larger string is that Repeats will take a long time and return a huge sequence, with about N^2/20 entries for a random string of N digits.  That's already 5 million for your 10000 digits.

Perhaps a better idea would be this.  Suppose you're interested in repetitions of length m in a string S of N digits.   Let T be a table indexed by m-digit strings.  For each m-digit string w in S, we check if T[w] exists; if it does, put a new entry in the table "mreps", otherwise make a new entry T[w] = (index where w starts in S).
 

So here is how I'd find repetitions of length 9 in the first 10^5 digits of Pi.  Again the expected number of these is about 5.

> with(StringTools):  
   PiDigits:= Delete(convert(evalf(Pi,10^5),string),2..2):
  for ind from 1 to 10^5-9 do
   w:= PiDigits[ind..ind+8];
   if assigned(T[w]) then mreps[w]:=[T[w],ind]
     else T[w]:= ind
   fi
 od: 
 eval(mreps);

TABLE(["041021944" = [21762, 75871], "134926158" = [69598, 86283], "201890888" = [30628, 33845]])

 

> f := sqrt;
  fx := add((D@@k)(f)(4)*(x-4)^k/k!, k = 0 .. 10);
  px := add(p[k]*(x-4)^k, k=0..4);
  qx := 1 + add(q[k]*(x-4)^k, k=1..4);
  T := taylor(qx*fx - px, x=4, 9);
  eqs:= {seq(coeftayl(T,x=4,j),j=0..8)};
  S:= solve(eqs);
  R44 := eval(px/qx, S);

R44 := (-5/2+9/8*x+27/128*(x-4)^2+15/1024*(x-4)^3+9/32768*(x-4)^4)/(-3/4+7/16*x+15/256*(x-4)^2+5/2048*(x-4)^3+1/65536*(x-4)^4)   

 

 

 

> f := sqrt;
  fx := add((D@@k)(f)(4)*(x-4)^k/k!, k = 0 .. 10);
  px := add(p[k]*(x-4)^k, k=0..4);
  qx := 1 + add(q[k]*(x-4)^k, k=1..4);
  T := taylor(qx*fx - px, x=4, 9);
  eqs:= {seq(coeftayl(T,x=4,j),j=0..8)};
  S:= solve(eqs);
  R44 := eval(px/qx, S);

R44 := (-5/2+9/8*x+27/128*(x-4)^2+15/1024*(x-4)^3+9/32768*(x-4)^4)/(-3/4+7/16*x+15/256*(x-4)^2+5/2048*(x-4)^3+1/65536*(x-4)^4)   

 

 

 

Yes, the help system is essentially the same in Classic and Standard.

For most purposes I generally prefer Classic.  There are a few features that require Standard, but those don't come up that often.

Yes, the help system is essentially the same in Classic and Standard.

For most purposes I generally prefer Classic.  There are a few features that require Standard, but those don't come up that often.

Shifting left is just multiplication by a power of 2.  Shifting right is integer division by a power of 2 (for which you can use iquo).

 

I know very little about Word Perfect, but since this is a Maple forum I assume you're creating your geometric diagrams in Maple and hoping to import them into Word Perfect.  Maple can produce several different types of graphics files.  Assuming Word Perfect can handle .gif files, the simplest method might be

1) Produce your graph in Maple

2) Right click on the graph, choose Export, Graphics Interchange Format.  Save the file with whatever name you choose.

3) Import that file into Word Perfect

I know very little about Word Perfect, but since this is a Maple forum I assume you're creating your geometric diagrams in Maple and hoping to import them into Word Perfect.  Maple can produce several different types of graphics files.  Assuming Word Perfect can handle .gif files, the simplest method might be

1) Produce your graph in Maple

2) Right click on the graph, choose Export, Graphics Interchange Format.  Save the file with whatever name you choose.

3) Import that file into Word Perfect

There are many things one can do with ordinary differential equations in Maple.
It's hard to help unless you're much more specific about what you're trying to do
and how you're trying to do it.  I might just mention that the main command for
solving ordinary differential equations is dsolve, and that it's a good idea to look at
the help pages, and in particular at the examples.

There are many things one can do with ordinary differential equations in Maple.
It's hard to help unless you're much more specific about what you're trying to do
and how you're trying to do it.  I might just mention that the main command for
solving ordinary differential equations is dsolve, and that it's a good idea to look at
the help pages, and in particular at the examples.

The answer for t=0..3 should be 0, of course.  But in Maple 11 I get


                             /{ t        t <= 0\
                     max(0, -|{                |)
                             \{ 0        0 < t /

which is clearly wrong.  At least the result for t=0..5 is honest:

Error, (in maximize) to be implemented

[ The Maple tag is acting up again:
max(0,-PIECEWISE([t, t <= 0],[0, 0 < t]))

does not work ]

 

The answer for t=0..3 should be 0, of course.  But in Maple 11 I get


                             /{ t        t <= 0\
                     max(0, -|{                |)
                             \{ 0        0 < t /

which is clearly wrong.  At least the result for t=0..5 is honest:

Error, (in maximize) to be implemented

[ The Maple tag is acting up again:
max(0,-PIECEWISE([t, t <= 0],[0, 0 < t]))

does not work ]

 

The easiest thing to do is to upload the code to MaplePrimes so the others can have a crack at it too.  Use the green up-arrow.

The easiest thing to do is to upload the code to MaplePrimes so the others can have a crack at it too.  Use the green up-arrow.

If you mean the compound matrix as defined in planetmath.org/encyclopedia/RthAdjugate.html

there isn't, but it's not hard to construct a command for it.

> compoundMatrix:= proc(M:: Matrix, r::posint)
      uses LinearAlgebra;
      local m,n, S, T;
      m, n := Dimension(M);
      S:= combinat[choose](m,r);
      T:= combinat[choose](n,r);
      Matrix(binomial(m,r), binomial(n,r),  
        (i,j) -> Determinant(M[S[i],T[j]]))
   end proc;

 

First 137 138 139 140 141 142 143 Last Page 139 of 187