Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8511357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:58:06+00:00 2026-06-11T03:58:06+00:00

The docs say All permutations occur with approximately equal likelihood. but I do not

  • 0

The docs say “All permutations occur with approximately equal likelihood.” but I do not know if that includes the (however small) possibility of returning the same ordering. I have a method (see below) where during two test runs the list was returned in the original order, maybe.. Other factors may have been at fault, like an anagram could have been selected and the result was a word. The lexicon is ~300,000 words, so I have changed the method to a more suitable test preventing this from being the case.
The method:

private static char[] nextScrambledWord(int wordLength) {

    String word;
    do {
        word = "ABCDEF"; //TODO Get a word from lexicon
    } while(word.length() != wordLength);

    ArrayList<Character> temp = new ArrayList<Character>(wordLength);
    for(int i = 0; i < wordLength; i++) {
        temp.add(word.charAt(i));
    }

    Collections.shuffle(temp);

    char[] result = new char[wordLength];
    for(int i = 0; i < wordLength; i++) {
        result[i] = temp.get(i);
    }
    return result;
}

I am also curious about the method itself. If anyone has a suggestion on how this can be improved, please feel free to share. Basically the method will pull a word of wordLength from a set, and return a char array of the shuffled result. Rather than polling a word of a known length, I have considered breaking the lexicon into multiple sets based on word length.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:58:08+00:00Added an answer on June 11, 2026 at 3:58 am

    Yes, it is possible that the original order is preserved, but, as you say, that is unlikely with longer lists. Try a list with only two elements to see this happen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

MSDN docs say that only value types need boxing, but this does not apply
The docs say: If not all the certificates needed to verify the leaf certificate
The GMP docs say that static linking may provide a small performance improvement. I
So the docs say : Messages are limited to 32K. That's actually all it
The PHPUnit docs say that I can shove all my tests into a folder
The Django docs say this on the subject: Note also that Django stores signal
The Speex docs say that it's 'mainly' designed for 8/16/32kHz sampling rates. Most PC
I've been using seesaw.tree/simple-tree-model to create my TreeModels, the docs say that this is
The docs for Camelot say that it uses Elixir models. Since SQLAlchemy has included
The docs about openssl_sign() say that the signature is returned in the passed string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.