 <p>if i'd understood your correctly, python example:</p> <pre><code>&gt;&gt;&gt; a=[1,2,3,4,5,6,7,8,9,0] &gt;&gt;&gt; &gt;&gt;&gt; &gt;&gt;&gt; len_a = len(a) &gt;&gt;&gt; b = [1] &gt;&gt;&gt; if len(set(a) - set(b)) &lt; len_a: ... print 'this integer exists in set' ... this integer exists in set &gt;&gt;&gt; </code></pre> <p>math base: <a href="http://en.wikipedia.org/wiki/Euler_diagram" rel="nofollow">http://en.wikipedia.org/wiki/Euler_diagram</a></p>