
Anagrams are two or more expressions which contain the same letters but which are arranged differently (e.g. “evil” and “vile” or “a gentleman” and “elegant man”). The notion of anagrams can be traced back to the ancient Greeks where it was viewed as a tool in uncovering mystical meanings of said words or expressions. My goal here is to try to explain an algorithm (or method) that checks if two expressions could be anagrams within the Armenian language.
I must first shed some light on the unique factorization theorem, which is the fundamental theorem of arithmetic. It states that every integer greater than one is either a prime number or itself can be a unique product of primes.
Prime numbers are whole numbers which can be divisible by their own self or by one and still give a whole number. For example, {2, 3, 5, 7, 11 et cetera} can only be divided by one or themselves in order to give us a whole number. Meanwhile, {4, 6, 8, 9} are each a unique product of said numbers (the primes) and that product can be rearranged with respect to its order only. For example, 6 will always equal the product of a 2 and a 3 no matter which number of the latter goes first. (2×3=6=3×2)
I offer a small tangent for people curious with arithmetic. The number 1 is not considered a prime because the uniqueness of the theorem would be lost (i.e. 123=1123=2×3=6=3×2 So you get the gist of it)
Why is this necessary for checking anagrams? Because the Armenian alphabet has 38 letters and our aim is to associate each letter of the alphabet with a prime.
“Ա” would be associated to the first prime, which is 2 and “ֆ” which is the last and 38th letter of the Armenian alphabet would be associated to 163 which is the 38th prime number, so now each letter of the alphabet ought to have its “prime” representation. The way to check if two or more expressions are anagrams in Armenian is to calculate the product of the prime representation of each letter of the expression, and if the products of said expressions are equal then they are anagrams.
Let’s take, for example, վրայ and վայր. If we write վրայ in terms of the prime numbers each of its letters represent, we get: 113, 131, 2, 73. We take the product of these primes, we get:113×131×2×73=2,161,238. Let’s do the same for վայր. That yields:113×273131=2,161,238 again!
The product of the prime representation of both words are equal, which shows that both words are in fact anagrams.
Another example:
ծնուել: 43×79×89×139×11×37=17,103,884,809
Լուծեն:37×89×139×43×11×79=17,103,884,809
Ծնելու:43×79×11×37×89×138=17,103,884,809
Special thanks to Garin Angoghinian and Daron Assadourian for providing me with a full database of Armenian anagrams.
Author information
The post A simple approach for checking anagrams within the Armenian language appeared first on The Armenian Weekly.