Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ ¹ ² ³ °
 

You are not logged in. Pages: 1
#1 20130123 22:51:43
How to reduce the time checking if two lists contain the same elementsSuppose you have two lists of elements, and you are wondering if they contain the same elements. You observe that the lists have the same lengths. You check that every element of the first list exists among the elements of the second list. To complete the process, you must find out if every element of the second list exists among the elements of the first list. Now you stop and think: is it necessary to do this last step? No, it is not because the following theorem exists: Last edited by Ivar Sand (20130130 23:33:19) I majored in Physics in 1976. Also, I studied mathematics and computer science. I work as a computer programmer. I am from Norway. #2 20130123 23:37:36
Re: How to reduce the time checking if two lists contain the same elementsHi Ivar Sand; In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #3 20130124 00:15:02
Re: How to reduce the time checking if two lists contain the same elementsHi Ivar Sand.
Normally to prove that a mapping is bijective, you have to show that it is both injective and surjective. However, if A and B are finite sets with the same number of elements (i.e. m = n) then the two statements above imply that ƒ will be bijective if we can show that it is EITHER injective OR surjective (so we don't have to waste them showing both). #4 20130124 20:22:13
Re: How to reduce the time checking if two lists contain the same elementsbobbym Thanks for your welcome, bobbym. I am glad to be here. I majored in Physics in 1976. Also, I studied mathematics and computer science. I work as a computer programmer. I am from Norway.
Pages: 1
