Carl Love

Carl Love

26832 Reputation

25 Badges

11 years, 287 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Bendesarts You still haven't uploaded the worksheet.

So that I can read your worksheet and answer your question, How does one view the Maple code that controls an embedded component?

@Markiyan Hirnyk Oops, I misread the Asker's example call. Thanks for spotting that. I will correct the Answer above.

@Markiyan Hirnyk Oops, I misread the Asker's example call. Thanks for spotting that. I will correct the Answer above.

@Markiyan Hirnyk Any two expressions that are built from the non-mutable data structures (such as names, numbers, floats, sets,  lists, algebraics, functions), no matter how complicated, will have the property that if they "appear" mathematically identical then they will be identical to Maple (i.e., stored at the same address). I know that "appear" is not totally precise; this is a difficult concept to understand. It is easier to define it in the negative: All of the mutable structures are essentially containers (but not all container structures are mutable!). Two mutable containers are not identical even if their contents are identical and are arranged the same way in the container. Non-mutable structures do not have that property.

ex1:= [x+y, {a, [1], .2, exp(.1)}, exp(z)]:
ex2:= [x+y, {a, [1], .2, exp(.1)}, exp(z)]:
evalb(ex1 = ex2);
                              true

addressof~([ex1,ex2]);
          [18446744073908797006, 18446744073908797006]

Another way to test identity: Put into a set.
{ex1, ex2};
       {[x + y, {0.2, 1.10517091807565, a, [1]}, exp(z)]}

nops(%);
                               1

{[x-> x^2], [x-> x^2]};
                     /[      2]  [      2]\
                    { [x -> x ], [x -> x ] }
                     \                    /

nops(%);
                               2

@Markiyan Hirnyk Any two expressions that are built from the non-mutable data structures (such as names, numbers, floats, sets,  lists, algebraics, functions), no matter how complicated, will have the property that if they "appear" mathematically identical then they will be identical to Maple (i.e., stored at the same address). I know that "appear" is not totally precise; this is a difficult concept to understand. It is easier to define it in the negative: All of the mutable structures are essentially containers (but not all container structures are mutable!). Two mutable containers are not identical even if their contents are identical and are arranged the same way in the container. Non-mutable structures do not have that property.

ex1:= [x+y, {a, [1], .2, exp(.1)}, exp(z)]:
ex2:= [x+y, {a, [1], .2, exp(.1)}, exp(z)]:
evalb(ex1 = ex2);
                              true

addressof~([ex1,ex2]);
          [18446744073908797006, 18446744073908797006]

Another way to test identity: Put into a set.
{ex1, ex2};
       {[x + y, {0.2, 1.10517091807565, a, [1]}, exp(z)]}

nops(%);
                               1

{[x-> x^2], [x-> x^2]};
                     /[      2]  [      2]\
                    { [x -> x ], [x -> x ] }
                     \                    /

nops(%);
                               2

@Markiyan Hirnyk The reason that your Vector subtraction example doesn't work is because Vectors are mutable data structures; it has nothing to do with unreliabilty of is.

@Markiyan Hirnyk The reason that your Vector subtraction example doesn't work is because Vectors are mutable data structures; it has nothing to do with unreliabilty of is.

@Markiyan Hirnyk 

If you don't trust is, then use evalb or addressof instead.

evalb([x-> x^2] = [x-> x^2]);
                             false

L1:= [x-> x^2]:  L2:= [x-> x^2]:
addressof(L1), addressof(L2);
           18446744073913194702, 18446744073913194862

The addressof is the ultimate test of this, since all equality checks and membership tests in Maple are based on identity, and two structures are identical iff they have the same address.

@Markiyan Hirnyk 

If you don't trust is, then use evalb or addressof instead.

evalb([x-> x^2] = [x-> x^2]);
                             false

L1:= [x-> x^2]:  L2:= [x-> x^2]:
addressof(L1), addressof(L2);
           18446744073913194702, 18446744073913194862

The addressof is the ultimate test of this, since all equality checks and membership tests in Maple are based on identity, and two structures are identical iff they have the same address.

@Markiyan Hirnyk Procedures are mutable data structures, like tables:

is([x-> x^2] = [x-> x^2]);
                             false

I think that the complete list of mutable data structures is tables, procedures, modules (which includes Records), and rtables (which includes Matrices, Vectors, and Arrays). I am not absolutely sure if that list is complete.

Note that any structure that contains parts that are mutable will itself be mutable.

@Markiyan Hirnyk Procedures are mutable data structures, like tables:

is([x-> x^2] = [x-> x^2]);
                             false

I think that the complete list of mutable data structures is tables, procedures, modules (which includes Records), and rtables (which includes Matrices, Vectors, and Arrays). I am not absolutely sure if that list is complete.

Note that any structure that contains parts that are mutable will itself be mutable.

@Bendesarts There was no file attached to your reply.

Give me some expressions that you've derived "by hand", and I'll show you how to evaluate them in Maple.

To be more precise, in your first problem you need to say how many total rolls and how many dice there are. For the second, you need to say the total number of cards drawn, and whether they are drawn with or without replacement.

Would it be possible to give a numeric value for the parameter g?

First 645 646 647 648 649 650 651 Last Page 647 of 693