Joe Riel

9660 Reputation

23 Badges

20 years, 5 days

MaplePrimes Activity


These are replies submitted by Joe Riel

@Carl Love My explanation of the error when |AB|=4 was wrong in that I was thinking you were using |A|=5 rather than |B|=5.  Assume the latter. The single element that belongs to B-A can go in one of two bins, either in B-A-C or in BC-A. It is that choice you are missing. The same issue arises |AB|=3, but in both A and B, hence the factor of 4 there.

@Carl Love My explanation of the error when |AB|=4 was wrong in that I was thinking you were using |A|=5 rather than |B|=5.  Assume the latter. The single element that belongs to B-A can go in one of two bins, either in B-A-C or in BC-A. It is that choice you are missing. The same issue arises |AB|=3, but in both A and B, hence the factor of 4 there.

@Markiyan Hirnyk The 25 elements that are not members of A or B are divided between S-(A+B+C) and C-(A+B) [those are disjoint]. There are 2^25 ways to do so. To see that, let each element correspond to a different bit in 25 bits. When a bit is 0 it goes into one set, when 1 it goes into the other. The total number of distinct patterns of 25 bits is 2^25. More generally, given e distinct elements and b bins, there are b^e to distribute the elements in the bins. So the same formula is used to compute the number of ways to distribute 2 elements into 5 bins (5^2). Simpler is to realize that each element has b choices, all of which are independent, so there are b^e possibilities.

@Markiyan Hirnyk The 25 elements that are not members of A or B are divided between S-(A+B+C) and C-(A+B) [those are disjoint]. There are 2^25 ways to do so. To see that, let each element correspond to a different bit in 25 bits. When a bit is 0 it goes into one set, when 1 it goes into the other. The total number of distinct patterns of 25 bits is 2^25. More generally, given e distinct elements and b bins, there are b^e to distribute the elements in the bins. So the same formula is used to compute the number of ways to distribute 2 elements into 5 bins (5^2). Simpler is to realize that each element has b choices, all of which are independent, so there are b^e possibilities.

@Markiyan Hirnyk I don't see how my method would generate a duplication.  Maybe I'm missing something, but it seems straightforward.  Of the 30 elements, 25 go into S - (A+B)  (30 C 5), 3 go into ABC (5 C 3), the remaining 2 go into the 5 boxes (5^2) I previously described.  All those sets are disjoint.  The 25 are split into two partitions (2^25).  The product of those is the desired result: (30 C 25)(5 C 3)(5^2)(2^25).  Explain how a duplication can occur with that scheme.

Note that because you labeled the three sets, I assume that one counts the arrangements that swap A and B as distinct. If not, then the computation is different.

@Markiyan Hirnyk I don't see how my method would generate a duplication.  Maybe I'm missing something, but it seems straightforward.  Of the 30 elements, 25 go into S - (A+B)  (30 C 5), 3 go into ABC (5 C 3), the remaining 2 go into the 5 boxes (5^2) I previously described.  All those sets are disjoint.  The 25 are split into two partitions (2^25).  The product of those is the desired result: (30 C 25)(5 C 3)(5^2)(2^25).  Explain how a duplication can occur with that scheme.

Note that because you labeled the three sets, I assume that one counts the arrangements that swap A and B as distinct. If not, then the computation is different.

The computation of |AB|=4 is incorrect.  You also have to consider whether the element is in AC-B or A-B-C.  It's easier to compute this using the method I did, which in your notation is (30 C 5)(5 C 3)(5^2)(2^25). The 5^2 term comes from putting two elements in any of 5 disjoint boxes (AC-B, A-B-C, AB-C, B-A-C, BC-A).

The computation of |AB|=4 is incorrect.  You also have to consider whether the element is in AC-B or A-B-C.  It's easier to compute this using the method I did, which in your notation is (30 C 5)(5 C 3)(5^2)(2^25). The 5^2 term comes from putting two elements in any of 5 disjoint boxes (AC-B, A-B-C, AB-C, B-A-C, BC-A).

@Markiyan Hirnyk  I assumed you wanted A union B union C = S. Apparently not.

@Markiyan Hirnyk  I assumed you wanted A union B union C = S. Apparently not.

Here is code, BreakBad.mpl, that does what you want.  You can execute it by reading the file into Maple, say with the command

read "BreakBad.mpl":

Then execute it via 

BreakBad( "some string" );

Here is code, BreakBad.mpl, that does what you want.  You can execute it by reading the file into Maple, say with the command

read "BreakBad.mpl":

Then execute it via 

BreakBad( "some string" );

When you create the DataTable embedded component, the field titled "Assign to variable" should be modified to a desired name (the default is DataTable0).  Say you change it to x, then click Ok. Now if you execute, in the worksheet,

x[1,2] := 23:

the cell in row 1, column 2 will be updated to 23.  Conversely, if you manually change that cell to, say, 34, then execute x[1,2] you will see that it is now assigned 34.  Same with the other cells.  You can also add code to the embedded component that is executed whenever you manually change a cell in the data table.

When you create the DataTable embedded component, the field titled "Assign to variable" should be modified to a desired name (the default is DataTable0).  Say you change it to x, then click Ok. Now if you execute, in the worksheet,

x[1,2] := 23:

the cell in row 1, column 2 will be updated to 23.  Conversely, if you manually change that cell to, say, 34, then execute x[1,2] you will see that it is now assigned 34.  Same with the other cells.  You can also add code to the embedded component that is executed whenever you manually change a cell in the data table.

@Carl Love Can't say I've ever seen the show.  I realized that removing the uppercase matching would change the algorithm; that was done merely to  avoid the nuisance of eliminating too many matches.  Figured a more interested party would restore it. 

You shouldn't have to use Typseset notation; it works fine for me in Maple 16 with the output display as 2D Math Notation (my normal setting).

Alas, Maple's use of MathML isn't documented. It uses a functional notation, rather than the tags of MathML, but the function names are the same as the MathML tags, which you can find on the web. Not all elements of MathML are handled. To figure out how a particular 2D display is represented, enter it into a 2D input region, select it, right-click, and convert it to an atomic identifier ( 2D-Math -> Convert To -> Atomic Identifier).  Then either copy and paste that to an input region, or evaluate and ?lprint the result. 

I've uploaded a Maple 16 worksheet that assigns BreakBad, shows an example of its usage, and shows an example of converting a 2D input to an atomic identifier and displaying the MathML

BreakBad.mw

First 51 52 53 54 55 56 57 Last Page 53 of 195