[GAP Forum] Find Intersection of Sequence

Siddiqua Mazhar s.mazhar at newcastle.ac.uk
Sat Jun 21 19:19:16 BST 2014


Dear Sir/Madam,

If we have a list like [[2,1],[5,2,1],[6,5,2,1],[9,10]] and I want to find the result in the form of [6,5,2,1].[9,10] and want to delete all those list that are contatined in the other. How may I progrme this

I do like let FV:= [[2,1],[5,2,1],[6,5,2,1],[9,10]];

Intersection:=function(FV)
local A,B,a;
for A in FV do
  for B in FV do
  if Intersection(A,B)=B then
  a:=Position(FV,B);
  Unbind(FV[a]);
  fi;
  od;
od;

return FV;
end;

However, this program gives me empty list. Could you please guide me in this program.
Thanks

Regards
Siddiqua



More information about the Forum mailing list