Displaying 2 results from an estimated 2 matches for "set_symdiff".
2018 Mar 18
1
How to take difference of sets when there is an empty subset involved
...uot;, "P2", "P3", "P4"}
y<-{}
A<-set(x,y)
#A={{}, {"P1", "P2", "P3", "P4"}}
i need to use A in a recursive loop where i need to take set difference of
A and it 's elements.
Example:
for (i in A){
print(i)
A<-set_symdiff(i,A) ###Imp line i need help on
print(A)
}
the program is unable to recognise the empty set in the set A. I tried
various methods in Imp line above:
> A-i
#Output : {{}, {"P1", "P2", "P3", "P4"}}
> set_symdiff(i,A)
Output: {{}, {"P1",...
2018 Mar 18
1
Set Difference Problem
...uot;, "P2", "P3", "P4"}
y<-{}
R<-set(x,y)
#R={{}, {"P1", "P2", "P3", "P4"}}
i need to use R in a recursive loop where i need to take set difference of
R and it 's elements.
Example:
for (r in R){
print(r)
R<-set_symdiff(r,R)
print(R)
}
the program is unable to recognise the null set in the set R. I tried
various funtions and methods:
> R-r
#Output : {{}, {"P1", "P2", "P3", "P4"}}
> set_symdiff(r,R)
Output: {{}, {"P1", "P2", "P3", &quo...