Set theory on HP Prime

05072014, 02:01 AM
Post: #1




Set theory on HP Prime
Hi all,
Does the prime have any facilities for dealing with sets such as union, difference, equality and such? for example in PSUDOCODE: {1, 2, 3} Union {2, 4, 5} = {1, 2, 3, 4, 5} {1, 2, 3} Intersection {2, 4, 5} = {2} {1, 2, 3} == {2, 1, 3} == TRUE ... 

05072014, 02:58 AM
Post: #2




RE: Set theory on HP Prime
Reading the Xcas documentation here and there is a full section on sets  tried using a similar syntax but the prime doesn't know what I'm on about. >;


05072014, 06:57 AM
Post: #3




RE: Set theory on HP Prime
Sets are supported: the infix operators are union, minus, intersect, and you should use set[ ] instead of {} or [ ] to avoid confusion with lists/vectors, e.g. for ==
set[1,2]==set[2,1] [1,2]==[2,1] 

05072014, 12:35 PM
(This post was last modified: 05072014 12:37 PM by norlesh.)
Post: #4




RE: Set theory on HP Prime
Thanks for the reply Parisse
I just tried evaluating the following in the home screen set[1,2]==set[2,1] ... result 1 set[1,2]==set[2,1,5] ... result 1 // WTF? am I not understanding set theory correctly? also every time set[..] gets evaluated it turns into set(..) and 'set(1,2) union set(2, 1, 5)' gives a syntax error... is there any documentation? 

05072014, 02:53 PM
Post: #5




RE: Set theory on HP Prime
Just tried on my emulator, set[1,2]==set[2,1,5] correctly returns 0 here and set[] are not converted to set(), so perhaps this is a UI bug that has been fixed.


05072014, 03:43 PM
Post: #6




RE: Set theory on HP Prime
(05072014 06:57 AM)parisse Wrote: Sets are supported: the infix operators are union, minus, intersect, and you should use set[ ] instead of {} or [ ] to avoid confusion with lists/vectors, e.g. for == Good to know! By the way, minus and union don't seem to appear in the toolbox catalog (intersect is in there, though). 

05072014, 03:48 PM
Post: #7




RE: Set theory on HP Prime
I have also tried out the commands mentioned by Parisse and they work correctly in CAS, but result in syntax error in Home.
A. 

05072014, 06:04 PM
Post: #8




RE: Set theory on HP Prime
Thanks guys  so I ran it under the CAS screen and can now confirm that set[1 2]==set[2 1 5] does indeed evaluate to zero... yey I don't have to learn a new formulation of set theory
{ just to be clear though it's definately still mutzed under the home screen as of the current firmware running on a physical device  I had no idea the calculators split brain disorder ran so deep!} 

05072014, 06:14 PM
Post: #9




RE: Set theory on HP Prime
(05072014 03:43 PM)Helge Gabert Wrote:(05072014 06:57 AM)parisse Wrote: Sets are supported: the infix operators are union, minus, intersect, and you should use set[ ] instead of {} or [ ] to avoid confusion with lists/vectors, e.g. for == There are the standard math symbols for union and intersection in the Chars list, but they do not work as such. 

05072014, 07:13 PM
Post: #10




RE: Set theory on HP Prime
The HP Prime never ceases to tease me. In CAS, if I type
[1,2,3] union [2,5] in the command line, it displays (correctly) union( [1,2,3], [2,5]) [1,2,3,5] But if I enter directly union( [1,2,3], [2,5]) in the command line, it reports syntax error. 

05082014, 07:03 AM
Post: #11




RE: Set theory on HP Prime
This is a textbook mode display bug, if you uncheck it in Settings, it's ok.


« Next Oldest  Next Newest »

User(s) browsing this thread: