I would like to set up a function which has to return True if at least two arguments of a given List are equal.
So if I give {1,4,6,2} to the function it has to return False (since none of his arguments are equal) and the same would happen if I gave {{1,2,3},{2,3,4}}, while if I gave {1,2,3,1,4} or {{1,2,3},{2,0,0},{1,2,3},{2,1,2}} it has to return True.
I know this is a very simple problem and i think you can easily tell me a convenient way to achieve that.


Signaturewhich has been there since v1 but which I've never noticed. Your claim of speed, though, is incorrect. It's only true for lists that actually contain a duplicate. Tryl = RandomInteger[100000, {1000000, 3}];and yourdupeQis almost 10 times slower than kguler'sduplicatesQ. I vote against this being a canonical answer. – Sjoerd C. de Vries Jun 13 '12 at 12:51l = RandomInteger[10, {1000000, 50}];and the timings are totally different.duplicatesQtotally can't handle this and yours is extremely much faster. It takes 5 secs for yours andduplicatesQis still running for a couple of minutes without finishing. Interesting behaviour... – Sjoerd C. de Vries Jun 13 '12 at 13:04RandomInteger[10, {1000000, 50}];? – image_doctor Jun 13 '12 at 14:18test[](defined in my answer) to be faster both on a and b. On my machine the timings are 4 and 12 for Signature based, and 1.4 on both forUnion[]based.Also, it seems like the first time I run Signature on a large dataset, the timing is always lower then repeating the exact same code. If I rerun the tests, both tests on signature give 12 seconds.
– jVincent Jun 13 '12 at 18:02a = Range[1*^7]; a[[{1, 50}]] = 3.14159;– Mr.Wizard Jun 13 '12 at 18:04a = Range[1*^7]; a[[{1, 50}]] = 3.14159;andb = Range[1*^7]; a[[{1, 1*^6}]] = 3.14159;Then on my Machine dupeQ wins on a with 0.063 against 0.984 for test and test wins b with 1.891 vs. 2.344 for dupeQ. To sum up, if there are duplicates then dupeQ wins because it can exit early, and if there are not any duplicates Union wins, most likely because Signatur has to suddenly figure out the actual signature, though oddly still slower if the duplicate is at the end – jVincent Jun 13 '12 at 18:16