cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Set Theory

Set Theory

Hi,

I have been using Mathcad for some years and have always found that it more than adequately supported my needs. However, I have recenetly needed to perform set theory operations such as union, itersection, difference, cartesian product, etc. I can see no straightforward way of doing this in Mathcad.

Have I overlooked some features, or this something beyond Matcad's capability?

regards.
38 REPLIES 38
Highlighted

Re: Set Theory

It can be done easilyCapture1.JPGCapture2.JPG

Highlighted

Re: Set Theory

Hi, I am reading a text entitled Introductory Real Analysis and the first chapter is a discussion of Set Theory.  In Mathcad Prime 5, I note that the symbols for Union, Intersection, Subset and Superset appear within the Math Symbols and the operator "Is an Element of" appears within the Boolean Operators but have found no guidance in the Boolean or other sections of the Help menu regarding these items.  I would like to know based on your detailed response to the prior question if you or any members of the PTC Community have found anything in the available Help documents that would describe how each of these items are used in the same or similar level of details shown in other Help topics.

Highlighted

Re: Set Theory

Here's an example of what you can do, in Mathcad Prime, with the boolean symbols:

LM_20190313_Boolean.png

Note that Mathcad knows vectors. To work with sets, you'll have to do some programming yourself; such as shown by jpilling above.

 

Success!
Luc

Highlighted

Re: Set Theory

Mathcad has not correct Boolean operators.

For both - fuzzy and not fuzzy logic (sets):

FL.png

Highlighted

Re: Set Theory

Hi, Valery,

 

More excellent information.  Thank you for your input.

Highlighted

Re: Set Theory


@gerrypete wrote:

Hi, Valery,

 

More excellent information.  Thank you for your input.


Thanks!

I have translated into English one my book - see two chapters from it in attach - about this topic.

If you have time and wish - correct please the content and my English! And send me the files back!

Highlighted

Re: Set Theory

Hi, Valery,

 

I've downloaded the files and find that you are pursuing a most interesting topic.  I hope that on the weekend I will be able to review them at least for grammatical purposes and provide some comments.  Good luck in your pursuit!

Highlighted

Re: Set Theory

Hi, Luc, thanks so much for the instruction.  It should have occurred to me that the symbols for union, intersection, subset and superset are in fact symbols as opposed to operators as in the case of "Is Element Of".

Highlighted

Re: Set Theory

"Is element of" in Mathcad Prime

EofSet.png

Highlighted

Re: Set Theory

Hi, Valery,

Prior to the posts that you and Luc provided, I was attempting to use the "Is Element Of" to arbitrary sets other than the real, rational, complex and integer sets provided in the Mathcad Prime 5 program.  I understand that the use of the "Is Element Of" function is limited to those four sequences.  Thanks for the illustration.

Highlighted

Re: Set Theory

Nice, all those boolean functions, but I gues you are really looking for this:

LM_20190314_Set operations.png

and more...

Note that in the above (as opposed to the few set functions published earlier) the same element does not occur twice in a set, as it should be for proper sets. I've implemented the functions to treat the scalar 0 as the empty set,

which is different from (0) as the set containing one element: a 0.

Note that you can use numbers and strings as set elements.

 

This to show that you can work with sets using Mathcad.

That should also go for Prime, however I think that Prime does not support the infix notation for a function name.

{The union function is defined as U(a,b):=.... and I can call it with "U(set1,set2)=...", but in (real) Mathcad I can also use the infix notation "set1 U set2 =..." as shown above, I see no way to do that in Prime.}

 

Success!
Luc

Highlighted

Re: Set Theory

Luc,

 

This is excellent!  Thanks for the information.

Highlighted

Re: Set Theory

Hi, Luc,

I found that entering the same expressions in Mathcad Prime 5 that are shown in your worksheet results in error messages.  I downloaded Mathcad Prime 5 for a power system analysis project and found differences between Mathcad 15 and Mathcad Prime 5 which I probably should have researched before my purchase. In any event, I understand that as a registered user of Mathcad Prime 5 I can download Mathcad 15 but though that I would touch base with you to determine which version of Mathcad you used to create your worksheet.

Thanks for the information!

Highlighted

Re: Set Theory

I use Mathcad 11.

 

Success!

Luc

Highlighted

Re: Set Theory

Unles you are heavily into symbolics (which has never been a strong capability), Mathcad 15 is as capable as Mathcad 11.  Mathcad 11 was the last version with the Maple symbolic processor.

Highlighted

Re: Set Theory

Hi, Fred,
Thanks for the information. I’ve noticed worksheets posted by some of our colleagues in the community using symbols from set notation such as “union” ∪, “intersection” ∩, “subset” ⊆ and others and using those symbols as operators in evaluating sets. In both Mathcad Prime 5 and Mathcad 15, however, they are included as symbols rather than operators and do not appear to have any operational functionality. In addition, the only functionality I’ve found is the use of the element operator ∈ which is restricted to the evaluation of “real” ℝ, “rational” ℚ, “integer” ℤ, and “complex” ℂ numbers.
I’ve also noticed that the sets used in the worksheets are enclosed in parentheses rather than braces which would be appropriate for sets. I haven’t been able to reconstruct those expressions in either Mathcad 15 or Mathcad Prime 5 so it looks like I have a little more homework to do.
Highlighted

Re: Set Theory

Hi, Luc,

 

Me again.  I just realized based on your comments in your worksheet that you can define functions for “union” ∪, “intersection” ∩, “subset” ⊆ and so on by assigning the corresponding symbols as operators to evaluate sets (example: (A,B).   I think I also just realized that the parentheses that enclose the elements of the sets are generated as the result of defining the functions.  I realized these points in responding to Fred's post so If I am correct, I will correct my post to him accordingly.  These points were clearly stated in your worksheet so I'll have to pay closer attention in the future..

 

Thanks again for your input.

Highlighted

Re: Set Theory

Hi,

I somehow dropped the ball in reviewing your worksheet in which you used programming to achieve the functionality of operations involving sets.  Perhaps my other colleagues in the PTC Community can disregard my prior inquiries into using the symbols from set notation available that are available in the symbol set in Mathcad to perform operations on sets.  Thanks for the guidance.

Regards,

Gerry

Highlighted

Re: Set Theory

See if the attached can make you happier.

 

Success!
Luc

Highlighted

Re: Set Theory

Hi, Luc,

Thanks again. At this point I will continue with my review of set theory as a prelude to real analysis and not be so concerned with representations in Mathcad.  The posts have nevertheless resulted in interesting discussions within this topic in the community.

Highlighted

Re: Set Theory

Couldn't resist the temptation, so here are the set functions that you should be able to readily use in Prime.

 

Success!
Luc

 

Let me know if there are any errors.

Highlighted

Re: Set Theory

Hi, Luc,

I would recommend to PTC that they hire you to develop the capabilities for evaluating sets into Mathcad.  In the process of wrapping up a fifty-year career in engineering, I found myself taking books from my bookshelf and reviewing topics such as convolution, Fourier and Laplace transforms and other topics that we used for solving electrical problems and became interested in working backwards towards the foundations of mathematics... and hence my renewed interest in set theory.  My wife says that I need a hobby.  In any event, I am currently reviewing some classic texts in set theory for the purpose of moving on to a review of real and complex analysis.  Perhaps my wife is correct.

Highlighted

Re: Set Theory

That's not the right type of application for Mathcad. Look at other tools like Maple or Mathematica.

Highlighted

Re: Set Theory

Thanks so much for your prompt reply.  I would like to have used the operator and symbols from set theory that are included in Mathcad Prime 5 (union, intersection, etc.) to evaluate the expressions contained in the Introductory Real Analysis text but I appreciated that you have prevented me from pursuing a dead end.

 

Regards,

 

Gerry

Highlighted

Re: Set Theory

Hi,

My small contribution:

Logic and Boole Algebra.jpg

Highlighted

Re: Set Theory

We have only one Boolean function (Peirce's arrow) and can create others:

Boollean.png

 

Highlighted

Re: Set Theory

Hi, Valery,
After a 50-year career in electrical engineering, I am semi-retired and am doing only consulting work at this point. I decided in my semi-retirement to review the field of mathematics from a mathematical viewpoint rather than the applied electrical engineering viewpoint to which I have been exposed throughout my career. I found that each time I consulted a particular reference from the field of mathematics, I am directed backwards to topics that I should have studied earlier. I am finally directed back to set theory which appears to be the starting point and perhaps the foundation for the study of mathematics.
I found on my bookshelf the text entitled Set Theory and Logic by Robert R. Stoll which I have found to be a better starting point than the Introductory Real Analysis text by Kolmogorov which is considerably more advanced.
In any event, even in semi-retirement, I don't seem to have as much time as I would like to advance my foray into pure mathematics but I find it to be a most interesting pastime.
Highlighted

Re: Set Theory

I hope you will like this part from one my article. Translate it in English please and put here please!

 

Полтора века назад путешествие по свету могли позволить себе только очень богатые и физически здоровые люди. Но с появлением современных транспортных средств такое удовольствие стало доступно «широким массам трудящихся», а не только избранным: сел в самолет, автомобиль или на поезд — и за короткое время с комфортом добрался до любого уголка Земли.
Что-то подобное можно сказать и о математике. Раньше в ее дебри могли забираться только избранные люди — люди с особыми математическими способностями (с особым «математическим слухом») и имеющие соответствующее математи-ческое образование. Но в настоящее время круг таких избранных существенно расширился за счет появления… компьютерных математических пакетов, которые облегчают путешествие в мир математики. Условно можно сказать, что возник некий массовый математический туризм.
И еще одно важное вводное замечание.
Для чего изучают математику в школе и в вузе?
Во-первых, для того, чтобы можно было освоить другие учебные профильные дисциплины: физику, химию, теоретическую механику, гидрогазодинамику, сопротивление материалов, инженерную графику, экономику, финансовое дело и т. д. Поэтому-то курс математики читают в самом начале учебы в вузе!
Во-вторых, всегда нужно помнить, что математика — это лучшая гимнастика (фитнесс) для ума. Изучая эту «королеву наук», мы развиваем свои умственные способности, которые пригодятся нам при решении не только чисто математических, но и разных производственных и житейских задач.
И в-третьих, изучение математики (путешествие в ее «дебрях») — это само по себе интересное и увлекательное занятие, которое может быть высокоинтеллектуальным хобби. Но без математических компьютерных пакетов простым людям до недавнего времени этого делать было почти невозможно, если, повторяем, не было особых математических талантов и соответствующего математического образования.

Highlighted

Re: Set Theory

Hi, Valery,

 

Your text would be a fascinating preface to any book on mathematics.  I wasn't able to translate "vysokointellektualnym" but everything else is thought-provoking.

Announcements