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 6196943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:43:54+00:00 2026-05-24T03:43:54+00:00

I built a word generator, it picks a length and then randomly picks letters

  • 0

I built a word generator, it picks a length and then randomly picks letters of the alphabet to make up words.

The program works but 99% of the output is rubbish as it is not observing the constructs of the English language, I am getting as many words with x and z in as I do e.

What are my options for biasing the RNG so it will use common letters more often.

I am using rand() from the stl seeded with the time.

  • 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-05-24T03:43:55+00:00Added an answer on May 24, 2026 at 3:43 am

    The output will still be rubbish because biasing the random number generator is not enough to construct proper English words. But one approach to biasing the rng is:

    1. Make a histogram of the occurences of letters in a large English text (the corpus). You’ll get something like 500 ‘e’, 3 ‘x’, 1 ‘q’, 450 ‘a’, 200 ‘b’ and so on.
    2. Divide an interval into ranges where each letter gets a slice, with the length of the slice being the number of occurences in the interval. a gets [0-450), b [450,650), …, q [3500,3501).
    3. Generate a random number between 0 and the total length of the interval and check where it lands. Any number within 450-650 gives you a b, but only 3500 gives you a ‘q’.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a word document with Word 2007 and saved it. Then i
I built this method to find the longest word in an array, but I'm
I built a template-based document generator using the Open XML SDK (1.0) , the
I built a Perl Inline::C module, but there is some oddity with the sorting.
I dynamically select a string built using another string. So, if string1='David Banner', then
I've built a VSTO add-in for Microsoft Word and deployed to a webserver. Installation
There's a minor but annoying bug, I think, in the Eclipse built-in Java formatter.
I'm trying to build a markov generator that takes an arbitrary length for the
is there a command line program that gives recursive word-based diff (on 2 directories)?
I built a very simple chat system... it works great and when the user

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.