Support an Apolyton OT that advertisers flee in terror from: Buy Stuff from Amazon (UK, CA, FR, DE). You know you were going to buy it anyway.
Page 1 of 2 1 2 LastLast
Results 1 to 30 of 50

Thread: what's the 5 letter word with the most one-word anagrams?

  1. #1
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11

    what's the 5 letter word with the most one-word anagrams?

    In other words, what 5 letters (not necessarily distinct) together can make up the most distinct 5 letter words.

    So far I can think of an 11 (11 different words made with the same 5 letters)
    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  2. #2
    MRT144
    Emperor MRT144's Avatar
    Join Date
    09 Oct 2002
    Location
    Seattle Washington
    Posts
    8,831
    Country
    This is MRT144's Country Flag
    Thanks
    144
    Thanked 92 Times in 74 Posts
    Local Date
    November 25, 2014
    Local Time
    21:11
    what is your word you have in mind?
    "I hope I get to punch you in the face one day" - MRT144, Imran Siddiqui
    'I'm fairly certain that a ban on me punching you in the face is not a "right" worth respecting." - loinburger

  3. #3
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    apres
    asper
    pears
    spear
    rapes
    reaps
    pares
    parse
    prase
    spare
    presa

    (the last one is iffy; it's a breed of dog and might be considered a proper noun)
    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  4. #4
    Ari Rahikkala
    King
    Join Date
    30 Oct 1999
    Location
    Shireroth
    Posts
    2,814
    Country
    This is Ari Rahikkala's Country Flag
    Thanks
    0
    Thanked 4 Times in 1 Post
    Local Date
    November 26, 2014
    Local Time
    07:11
    Well, hell. I must say that I managed to impress myself with Haskell.

    Code:
    module Main where
    import Data.List
    import Data.Char
    
    length_order a b = let l_a = length a
    		       l_b = length b
    		       order | l_a == l_b = EQ
    			     | l_a < l_b  = LT
    			     | l_a > l_b  = GT
    		       in order
    
    main = interact $
           (\line -> unlines . take 1 . last . sortBy length_order 
           . group . sort . map sort . map (map toLower) 
           . filter (\line -> length line == 5) $ words line)
    (a couple of hours later, I realised that length_order was comparing in reverse... I'd just quickly hacked it up in order to get the right result. Fixed.)

    This code finds out that the letter combination to look out for is "agnor" (in alphabetic order, all-lowercase). Here's another program, to find out what words actually anagrammize to that:

    Code:
    module Main where
    import Data.List
    import Data.Char
    
    main = interact $
           (\input -> unlines $ filter 
    	(\word -> (sort (map toLower word)) == "agnor") $ lines input)
    Code:
    angor
    argon
    goran
    grano
    groan
    nagor
    Orang <-- please remember I've been
    orang <-- using a Unix for 7 years
    organ
    rogan
    Ronga

    (the source for these words is, of course, /usr/share/dict/words, aka Webster's Second International, from 1934)
    Last edited by Ari Rahikkala; December 1, 2006 at 19:47.
    This is Shireroth, and Giant Squid will brutally murder me if I ever remove this link from my signature | In the end it won't be love that saves us, it will be mathematics | So many people have this concept of God the Avenger. I see God as the ultimate sense of humor -- SlowwHand

  5. #5
    Chemical Ollie
    King Chemical Ollie's Avatar
    Join Date
    08 Jan 2002
    Location
    On my fat arse
    Posts
    1,802
    Country
    This is Chemical Ollie's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    November 26, 2014
    Local Time
    07:11
    Does any language count?
    So get your Naomi Klein books and move it or I'll seriously bash your faces in! - Supercitizen to stupid students
    Be kind to the nerdiest guy in school. He will be your boss when you've grown up!

  6. #6
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    Haskell

    It's not that hard to do something similar in a normal language

  7. #7
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    Originally posted by Ari Rahikkala
    Well, hell. I must say that I managed to impress myself with Haskell.
    Here's mine. A combination of C and bash:

    First I took a wordlist (only 5 letter words) with one word on each line. Then I used gedit to add in a series of bash commands (using find/replace on the newlines) so I got a second file like this.

    5letscr.sh

    Code:
    #!/bin/bash
    
    bash jmb2.sh abaca
    .
    .
    .
    bash jmb2.sh zymes
    jmb2.sh

    Code:
    #!/bin/bash
    gcc -o jmb2.out jmb2.c
    echo $1 > jmbtmpfile
    ./jmb2.out < jmbtmpfile > words2.sh
    rm jmbtmpfile
    bash ./words2.sh
    jmb2.c

    Code:
    #include 
    #include  
    
    int rvd5(int a, int b, int c, int d, int e);
    int rvd6(int a, int b, int c, int d, int e, int f);
    
    main()
    
    {
    
    	char word[80];
      int count, tag, i, j, k, l, m, n;
      
    	for (count=0; (word[count] = getchar()) != '\n'; ++count)
    		;
    	tag = count;
    		
    	printf ("#!/bin/bash\n");
    	printf ("rm -f jmbtmpfile\n");
    
    	if (tag == 5) {
    	for (i = 0; i <= 4; i++){
    		for (j = 0; j <= 4; j++){
    			for (k = 0; k <= 4; k++){
    				for (l = 0; l <= 4; l++){
    					for (m = 0; m <= 4; m++){
    						if (rvd5(i,j,k,l,m) != 0)
    							printf("grep -c \'%c%c%c%c%c\' 5letlist.txt >> jmbtmpfile \n", word[i], word[j], word[k], word[l], word[m]);
    					}
    				}
    			}
    		}
    	}
    	}
    	
    	if (tag == 6) {
    	for (i = 0; i <= 5; i++){
    		for (j = 0; j <= 5; j++){
    			for (k = 0; k <= 5; k++){
    				for (l = 0; l <= 5; l++){
    					for (m = 0; m <= 5; m++){
    						for (n = 0; n <= 5; n++){
    							if (rvd6(i,j,k,l,m,n) != 0)
    								printf("grep -c \'%c%c%c%c%c%c\' 6letlist.txt >> jmbtmptile \n", word[i], word[j], word[k], word[l], word[m], word[n]);
    						}
    					}
    				}
    			}
    		}
    	}
    	}
    	
    	printf("grep -c \'1\' jmbtmpfile \n");
    
    }
    
    int rvd5(int a, int b, int c, int d, int e)
    
    {
    
    	int ans = 1;
    	
    	if (a == b)
    		ans = 0;
    	if (a == c)
    		ans = 0;
    	if (a == d)
    		ans = 0;
    	if (a == e)
    		ans = 0;
    	if (b == c)
    		ans = 0;
    	if (b == d)
    		ans = 0;
    	if (b == e)
    		ans = 0;
    	if (c == d)
    		ans = 0;
    	if (c == e)
    		ans = 0;
    	if (d == e)
    		ans = 0;
    		
    	return(ans);
    	
    }
    
    int rvd6(int a, int b, int c, int d, int e, int f)
    
    {
    
    	int ans = 1;
    	
    	if (a == b)
    		ans = 0;
    	if (a == c)
    		ans = 0;
    	if (a == d)
    		ans = 0;
    	if (a == e)
    		ans = 0;
    	if (a == f)
    		ans = 0;
    	if (b == c)
    		ans = 0;
    	if (b == d)
    		ans = 0;
    	if (b == e)
    		ans = 0;
    	if (b == f)
    		ans = 0;
    	if (c == d)
    		ans = 0;
    	if (c == e)
    		ans = 0;
    	if (c == f)
    		ans = 0;
    	if (d == e)
    		ans = 0;
    	if (d == f)
    		ans = 0;
    	if (e == f)
    		ans = 0;
    		
    	return(ans);
    	
    }
    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  8. #8
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    We wrote that program correctly in my sophomore year of HS

  9. #9
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    I'm a shitty programmer

    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  10. #10
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    I remember writing a variant that cheated on Text Twist

  11. #11
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    Mine was originally written to cheat on the jumble in the paper. That's why it's roundabout. I already had something written. And that's why it's called jmb2.c and jmb2.sh...
    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  12. #12
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    It took ~5 minutes to adapt to this purpose...and I wanted practice scripting in bash...
    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  13. #13
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    You're probably better than I am a bash scripting. I just use linux for Matlab and C.

  14. #14
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    So, how's your probability class going?

    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  15. #15
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    Originally posted by Kuciwalker
    You're probably better than I am a bash scripting. I just use linux for Matlab and C.
    I wrote my first bash script two days ago
    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  16. #16
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    I'll gladly let you have all the set theory and epsilon-delta

  17. #17
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    I particularly liked how instead of writing something that counted +1 every time it found a match instead I wrote to a temp file and grep -c for 1s in that temp file.

    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  18. #18
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    To be honest, I responded how I did as soon as I saw your rvd6 function

  19. #19
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    I'm lazy and copy-paste is way too easy.
    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  20. #20
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    It takes all of three lines using loops. And you can generalize to strings of any length.

  21. #21
    KrazyHorse
    Deity KrazyHorse's Avatar
    Join Date
    29 May 2001
    Location
    138% of your RDA of Irony
    Posts
    24,766
    Thanks
    6
    Thanked 70 Times in 41 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    It took me ~45 seconds to write that function. Thinking would have cost extra time.
    04-06-04 Killdozer NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

  22. #22
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    Code:
    int rvdn(int n, char* string, int stringlen) {
    for(int i = 0; i < stringlen; i++)
       for(int j = i; j < stringlen; j++)
          if(string[i] == string[j]) return 0;
    return 1; }
    Divide the time by about 4 for previewing and fixing tags

  23. #23
    Impaler[WrG]
    King Impaler[WrG]'s Avatar
    Join Date
    06 May 2002
    Location
    Civ4 Colonization UI Programmer
    Posts
    2,473
    Country
    This is Impaler[WrG]'s Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    November 25, 2014
    Local Time
    22:11
    You could cut down the number of permutation that need to be checked by atleast an order of magnitude by forcing two of the letters to be vowels.
    Companions 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

  24. #24
    MRT144
    Emperor MRT144's Avatar
    Join Date
    09 Oct 2002
    Location
    Seattle Washington
    Posts
    8,831
    Country
    This is MRT144's Country Flag
    Thanks
    144
    Thanked 92 Times in 74 Posts
    Local Date
    November 25, 2014
    Local Time
    21:11
    Originally posted by Kuciwalker
    We wrote that program correctly in my sophomore year of HS
    goddamnit

    "I hope I get to punch you in the face one day" - MRT144, Imran Siddiqui
    'I'm fairly certain that a ban on me punching you in the face is not a "right" worth respecting." - loinburger

  25. #25
    Ari Rahikkala
    King
    Join Date
    30 Oct 1999
    Location
    Shireroth
    Posts
    2,814
    Country
    This is Ari Rahikkala's Country Flag
    Thanks
    0
    Thanked 4 Times in 1 Post
    Local Date
    November 26, 2014
    Local Time
    07:11
    Originally posted by Kuciwalker
    Code:
    int rvdn(int n, char* string, int stringlen) {
    for(int i = 0; i < stringlen; i++)
       for(int j = i; j < stringlen; j++)
          if(string[i] == string[j]) return 0;
    return 1; }
    Divide the time by about 4 for previewing and fixing tags
    Never mind that n is completely unused, that it always returns 0, and this:

    Code:
    rvdn str = (sort str) == (nub $ sort str)


    Yes, it isn't as fast to run. But it sure is easy to look at the line and think "hm, this checks if the given list (strings are lists of char in Haskell), sorted, is the same as the same given list, sorted, and with sequences of duplicate elements collapsed... so, in other words, it checks for whether there are any duplicate elements in a list."
    This is Shireroth, and Giant Squid will brutally murder me if I ever remove this link from my signature | In the end it won't be love that saves us, it will be mathematics | So many people have this concept of God the Avenger. I see God as the ultimate sense of humor -- SlowwHand

  26. #26
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    Never mind that n is completely unused, that it always returns 0, and this:


    i+1

    I'm not sure why n went there.

    Anyway, it's easier to detect bugs in mine than his, since his could be missing a line and you wouldn't notice.

  27. #27
    Ari Rahikkala
    King
    Join Date
    30 Oct 1999
    Location
    Shireroth
    Posts
    2,814
    Country
    This is Ari Rahikkala's Country Flag
    Thanks
    0
    Thanked 4 Times in 1 Post
    Local Date
    November 26, 2014
    Local Time
    07:11
    Originally posted by Impaler[WrG]
    You could cut down the number of permutation that need to be checked by atleast an order of magnitude by forcing two of the letters to be vowels.
    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.

    Originally posted by Kuciwalker
    Anyway, it's easier to detect bugs in mine than his, since his could be missing a line and you wouldn't notice.
    Quite true... it's too bad that my version is too short to find any bugs in .
    This is Shireroth, and Giant Squid will brutally murder me if I ever remove this link from my signature | In the end it won't be love that saves us, it will be mathematics | So many people have this concept of God the Avenger. I see God as the ultimate sense of humor -- SlowwHand

  28. #28
    Ari Rahikkala
    King
    Join Date
    30 Oct 1999
    Location
    Shireroth
    Posts
    2,814
    Country
    This is Ari Rahikkala's Country Flag
    Thanks
    0
    Thanked 4 Times in 1 Post
    Local Date
    November 26, 2014
    Local Time
    07:11
    Code:
    rvdn :: (Eq a) => [a] -> Bool -- to keep the monomorphism  restriction from biting you
    rvdn = any (\x -> (head x) `elem` (tail x)) . init . tails
    I'm really just playing around, trying to learn stuff in Haskell, but I figured that it was appropriate to post this different version of this function because it's better in a number of ways:

    - it can deal with types for which equality is defined but order isn't, that is, you can pass it stuff like complex numbers
    - it can deal with some limited cases of infinite lists and lists with undefined elements that the sorting version couldn't
    - it probably performs a bit better than the earlier version
    - it's pointlesspoints-free
    Last edited by Ari Rahikkala; December 1, 2006 at 21:39.
    This is Shireroth, and Giant Squid will brutally murder me if I ever remove this link from my signature | In the end it won't be love that saves us, it will be mathematics | So many people have this concept of God the Avenger. I see God as the ultimate sense of humor -- SlowwHand

  29. #29
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,465
    Thanks
    9
    Thanked 22 Times in 17 Posts
    Local Date
    November 26, 2014
    Local Time
    00:11
    - 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 numbers

  30. #30
    Petek
    King Petek's Avatar
    Join Date
    28 Jul 2000
    Location
    Berkeley, CA
    Posts
    1,096
    Country
    This is Petek's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    November 25, 2014
    Local Time
    22:11
    Originally posted by Kuciwalker
    You can order complex numbers
    Not with the usual definition of an ordered field.

    See here, for example.
    "The avalanche has already started. It is too late for the pebbles to vote."
    -- Kosh

Page 1 of 2 1 2 LastLast

Similar Threads

  1. New word for the day.
    By Dinner in forum Off Topic
    Replies: 2
    Last Post: May 22, 2005, 12:36
  2. Victory for the 4 letter F word: You can now say the word on TV!
    By Shi Huangdi in forum Off-Topic-Archive
    Replies: 17
    Last Post: November 1, 2003, 16:54
  3. Any word...?
    By Willem in forum Civilization III
    Replies: 52
    Last Post: October 14, 2003, 13:27
  4. MS Word Help please
    By The Andy-Man in forum Off-Topic-Archive
    Replies: 18
    Last Post: October 2, 2003, 15:36
  5. trying to think of a word
    By Blisterz in forum Off-Topic-Archive
    Replies: 14
    Last Post: January 18, 2003, 21:44

Bookmarks

Posting Permissions