I didn't say it was an ordered field
Announcement
Collapse
No announcement yet.
what's the 5 letter word with the most one-word anagrams?
Collapse
X
-
Good idea . It took the execution time of my Haskell program for going through /usr/share/dict/words (234937 lines, 2486824 bytes) from ~1.7 seconds to ~1.5 seconds.
- drop all matching vowels
- drop very rare consinents like x and z
- restrict the 3 other letters to consinents only
- drop all matching consinents
The base posibilities are 26^5th power = 11,881,376
With agressive culling its 5 * 4 * 19 * 18 * 17 = 116,280
A full two orders of magnitude reductionCompanions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest. - Thus spoke Zarathustra, Fredrick Nietzsche
Comment
-
Originally posted by Kuciwalker
- it can deal with types for which equality is defined but order isn't, that is, you can pass it stuff like complex numbers
You can order complex numbers12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
-
Witches! All of them! Burn them! Burn them now!“As a lifelong member of the Columbia Business School community, I adhere to the principles of truth, integrity, and respect. I will not lie, cheat, steal, or tolerate those who do.”
"Capitalism ho!"
Comment
-
Originally posted by Kuciwalker
Radix sort. Order them first by real part, then imaginary12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
-
Originally posted by KrazyHorse
Does not obey rules of total order.
It's possible to totally order the complex numbers, it's just not possible to get an ordered field, like Petek said (the total ordering is not compatible with the operations basically).
EDIT: I hope this is not a new trend of Kuci owning KH
BTW Kuci, your initial remark about ordering complex numbers was pointless . If you consider what you were replying to carefully, you'll see that it's just "witty" and doesn't actually have anything to do.Last edited by Lul Thyme; December 2, 2006, 13:07.
Comment
-
So we've seen Linux geek code (Ari), physicist/mathematician code (KH), and now for some software engineer code (in Java for variety):
Code:import java.io.IOException; public class Anagram { int size, count; char[] arr; public static void main(String[] args) throws IOException { String input = args[0]; size = input.length(); count = 0; arr = new char[size]; for (int i = 0; i < size; i++) arr[i] = input.charAt(i); anagram(size); } public static void rotate(int anagramSize) { int i; int position = size - anagramSize; char temp = arr[position]; // 1st letter for (i = position + 1; i < size; i++) // push the rest left arr[i - 1] = arr[i]; arr[i - 1] = temp; // now put the 1st on the end } public static void anagram(int anagramSize) { int limit; if (anagramSize != 1) // if 1, this is useless this is useless so don't do anything { for (int i = 0; i < anagramSize; i++) { anagram(anagramSize - 1); // anagram the last bits if (anagramSize == 2) // the innermost anagram { for (int i = 0; i < size; i++) // display it System.out.print(arr[i]); System.out.println(); } // end if else rotate(anagramSize); // rotate word } // end for } // end if } // end anagram() }
"The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
-
Oops.
I forgot what a total order on a set was (as opposed to on a field)...12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
-
^^Asher
The right way to do it12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
-
Originally posted by KrazyHorse
Oops.
I forgot what a total order on a set was (as opposed to on a field)...12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
Comment