SET functions
Modérateur : xcasadmin
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
SET functions
Hi, BP
Does GIAC have functions to determine if one set is a subset of another? In addition, if an element belongs or not to a set and function to make the product Cartesian.
Thanks
Does GIAC have functions to determine if one set is a subset of another? In addition, if an element belongs or not to a set and function to make the product Cartesian.
Thanks
Re: SET functions
is_element(1,[1,2,3]) or contains([1,2,3],1)
set[1,2]*set[3,4]
set[1,2]*set[3,4]
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: SET functions
thanks ^
and these two basic functions
Complement of a set and
Symmetric difference of sets
and these two basic functions
Complement of a set and
Symmetric difference of sets
Re: SET functions
minus
I would appreciate if you could take a look at the help and documentation before posting. I mean if you open the Prg>Set menu you will see the minus command or if you open Help>Index for union, you will see in "See also" intersect and minus.
I would appreciate if you could take a look at the help and documentation before posting. I mean if you open the Prg>Set menu you will see the minus command or if you open Help>Index for union, you will see in "See also" intersect and minus.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: SET functions
I mean the functions
Symmetric difference of sets: M Δ N
Complement of a set:
M' U
N' U
M:= set[ "A", "B", "C"]
N:= set[ "B", "G", "L", "E"]
U:= set[ "A", "B", "C", "G", "L", "E", "I", "J", "F", "H"]
M union N [↵] set["A","B","C","G","L","E"]
M intersect N [↵] set["B"]
M minus N [↵] set["A","C"]
M Δ N [↵] set[ "A", "C", "G", "L", "E"]
M' U [↵] set[ "J", "F", "G", "L", "E", "I", "H"]
N' U [↵] set[ "I", "H", "J", "F", "A", "C" ]
Symmetric difference of sets: M Δ N
Complement of a set:
M' U
N' U
M:= set[ "A", "B", "C"]
N:= set[ "B", "G", "L", "E"]
U:= set[ "A", "B", "C", "G", "L", "E", "I", "J", "F", "H"]
M union N [↵] set["A","B","C","G","L","E"]
M intersect N [↵] set["B"]
M minus N [↵] set["A","C"]
M Δ N [↵] set[ "A", "C", "G", "L", "E"]
M' U [↵] set[ "J", "F", "G", "L", "E", "I", "H"]
N' U [↵] set[ "I", "H", "J", "F", "A", "C" ]
Re: SET functions
I mean you can use minus for complementary and for the symmetric difference.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: SET functions
ok
Δ (Symmetric difference ) = (N minus M) union (M minus N)
//
In the help of XCAS-PC says that
is_element() Returns 1 if the point is on the geometric object and 0 otherwise.
You can apply this characteristic in sets object, that is, instead of returning the position (#), return a true / false symbolic value,
Since there are functions that return the position of an element
contains("a",set["b","a","c","a"]) [↵] 2
contains("d",set["b","a","c","a"]) [↵] 0
is_element("a",set["b","a","c","a"]) [↵] 2 => true
is_element("d",set["b","a","c","a"]) [↵] 0 => false
Thanks
Δ (Symmetric difference ) = (N minus M) union (M minus N)
//
In the help of XCAS-PC says that
is_element() Returns 1 if the point is on the geometric object and 0 otherwise.
You can apply this characteristic in sets object, that is, instead of returning the position (#), return a true / false symbolic value,
Since there are functions that return the position of an element
contains("a",set["b","a","c","a"]) [↵] 2
contains("d",set["b","a","c","a"]) [↵] 0
is_element("a",set["b","a","c","a"]) [↵] 2 => true
is_element("d",set["b","a","c","a"]) [↵] 0 => false
Thanks
Re: SET functions
It's more precise to have the position and it's the same for testing.