tomleslie

5358 Reputation

17 Badges

9 years, 301 days

MaplePrimes Activity


These are questions asked by tomleslie

  1. The member() function doesn't find the value in a table if that value is associated with the key (aka index)  '0'
  2. Doesn't seem to matter if the table is created explicitly (ie by calling table()) or implicitly (ie by simple indexed assignment)
  3. member() doesn't seem to have the same issue with a zero-based Array()
  4. I'm pretty sure that this is a bug, but I'd like some opinions before I report it
  5. This behaviour has been around for a while: same thing happens all the way back to Maple 18. (I can't check anything earlier)

Check the ouput of member(10,t1) in the attached

  restart:

  interface(version);

`Standard Worksheet Interface, Maple 2019.1, Windows 7, May 21 2019 Build ID 1399874`

(1)

#
# Explicit table creation: same thing
# happens if table is created "implicitly"
#
  t1:=table([0=10, 1=12]);
  member(10,t1);
  member(12,t1);

table( [( 0 ) = 10, ( 1 ) = 12 ] )

 

false

 

true

(2)

#
# Zero-based Array
#
  A:=Array(0..1, [10, 12]);
  member(10,A);
  member(12,A);

Array(%id = 18446744074528920750)

 

true

 

true

(3)

 

Download memberProp.mw

Generally when I respond to questions on this site, I make sure that I tick the checkbox requesting that I get an email when updates are made to the thread.

I've just realised that I have been receiving no such updates for a week or so. Two possibilities

  1. Problem with Mapleprimes website, meaning that email updates aren't being generated/sent
  2. Problem with my ISP

Before I try investigating (2) above, I'd just like to know if anyone else has seen any issue which might be explained by (1) above

If I create  and save a worksheet in Maple 2019, then try to up load it here, it uploads but contents won't display

No issue if I have an "identical" worksheet in Maple 2018.

See the attachment attempts below

#### Result of trying to upload Maple 2019 file here


Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/fibon2019.mw .
 

Download fibon2019.mw

But "same" file from Maple 2018 "works"

#
# Recursive Fibonacci generator
#
  myFib:= proc(n::integer)
               option remember;
               if   n=1
               then return 1
               elif n=0
               then return 0
               else return myFib(n-1)+myFib(n-2):
               fi:
          end proc:

  seq(myFib(j), j=0..20);

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765

(1)

 


 

Download fibon2018.mw

You use curly braces, ie '{}' as a container. Within Maple such curly braces designate a set, and Maple will always display sets in "lexicographic" order.

Since order has no meaning for entries in a set, trying to "sort" a set is meaningless. You can only sort lists, Arrays etc where the concept of order meaningful

See the attached for examples of sorting sets, lists, Arrays, and note that sorting of sets doesn't do anything useful

For future reference

  1. This should be a "Question", not a "Post" (and if I knew how to move it I would!)
  2. When posting on this site, try to avoid using third party sites like dropbox. Upload code (not pictures of code) using the big green up-arrow in the Mapleprimes toolbar

  restart;
  alpha:=[2,3,4,5];
#
# Try sorting sets - won't work because
# order is meaningless in a set
#
  sort( {abs(alpha[1]-30),abs(alpha[2]-30),abs(alpha[3]-30),abs(alpha[4]-30)}, `<`);
  whattype(%);
  sort( {abs(alpha[1]-30),abs(alpha[2]-30),abs(alpha[3]-30),abs(alpha[4]-30)}, `>`);
  whattype(%);
#
# Do the same thing with lists, where order is significant
#
  sort( [abs(alpha[1]-30),abs(alpha[2]-30),abs(alpha[3]-30),abs(alpha[4]-30)], `<`);
  whattype(%);
  sort( [abs(alpha[1]-30),abs(alpha[2]-30),abs(alpha[3]-30),abs(alpha[4]-30)], `>`);
  whattype(%);
#
# You can also sort entries in an Array()
#
  sort(Array([abs(alpha[1]-30),abs(alpha[2]-30),abs(alpha[3]-30),abs(alpha[4]-30)]), `<`);
  whattype(%);
  sort(Array([abs(alpha[1]-30),abs(alpha[2]-30),abs(alpha[3]-30),abs(alpha[4]-30)]), `>`);
  whattype(%);

alpha := [2, 3, 4, 5]

 

{25, 26, 27, 28}

 

set

 

{25, 26, 27, 28}

 

set

 

[25, 26, 27, 28]

 

list

 

[28, 27, 26, 25]

 

list

 

Vector[row](4, {(1) = 25, (2) = 25, (3) = 25, (4) = 25})

 

Array

 

Array(%id = 18446744074423548974)

 

Array

(1)

 

Vector[row](4, {(1) = 25, (2) = 25, (3) = 25, (4) = 25})

 

Array

 

Array(%id = 18446744074423548974)

 

Array

(2)

 

Download sortSet.mw

Earlier today (30/12/2018), I answered a fairly routine question  relating to solving the PDE for a vibrating string problem where the initial string profile was given by a piecewise function. No big deal - a fairly simple answer. Only thing that struck me at the time as odd/unusual, was that 2-3 days ago there was a very (very!) similar problem which I had also answered.

These two problems were posted from different usernames, but I did reference the earlier problem in my solution to the later one, just because they were so similar.

Both of these questions (and obviously my answers) have now "disappeared" -how/why?

  1. I can (just about?) understand that an OP might be allowed to delete his/her question, but I am surprised that (s)he can delete a complete thread - ie after response(s) have been provided
  2. I suspect that both questions came from the same individual employing different user names (why?). I guess this is pretty much impossible for MapleSoft to verify, particularly if the OP has multiple email addresses??
  3. Would I be correct in assuming that this is a method for students to get their homework" done whilst leaving little/no trace for their academic supervisors to find?
  4. Since all trace of both questions have disappeared and I can't actually remember the usernames (or emails with which they are associated), presumably the OP could repeat this behaviour indefinitely?
1 2 3 4 Page 1 of 4