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

  • SEARCH
  • Home
  • 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 8672345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:10:52+00:00 2026-06-12T19:10:52+00:00

I have a language consisting of the words having exactly two 1 and three

  • 0

I have a language consisting of the words having exactly two “1” and three “0”. How can I efficiently enumerate the finite set of all words of this language?

  • 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-12T19:10:53+00:00Added an answer on June 12, 2026 at 7:10 pm

    Easy, write the number 11100, calculate the number of permutation of this value = n! = 5!,
    divide by the number of permutation of the 3 1’s = 3! and the number of permutation of 0’s = 2! => 5! / (2! * 3!) = 120 / (6 * 2) = 10

    11100
    11010
    11001
    10110
    10101
    10011
    01110
    01101
    01011
    00111
    

    Now if you need the actual values, for an arbitrary language, you have no other choice but to use a backtracking algorithm.

    For this particular case, you can easily build a simple algorithm generating this language:
    Here’s an example using python

    def GenerateLanguage(nZeros, nOnes):
        if nZeros + nOnes == 0:
             return ['']
        res = [] # Resulting list, initialize with 1 empty string
        if nOnes > 0: # If we have 1's left, build all the strings that starts with a 1
             for l in GenerateLanguage(nZeros, nOnes - 1):
                  res.append('1' + l)
        if nZeros > 0: # If we have 0's left, build all the strings that starts with a 0
             for l in GenerateLanguage(nZeros - 1, nOnes):
                  res.append('0' + l)
        return res
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I need to have multiple language support of my django admin application.I can
I have a cross-language problem regarding md5 :). I have this code in Java:
In Oracle I have a table called Category consisting of three columns: ID =
I have a Python system consisting of around 9-10 classes all implementing most of
I have an interval consisting of two float numbers, and need to generate 20
I have a database consisting of the following tables: SourcesA: source, country, language SourcesB:
Say I have two sets of data, each entry consisting of a weight. Each
So I have a language setting in my application. When the language is switched,
Is there an easy way to have the language of the modx backend interface
Is there a way to have Expression Language (EL) expressions included JavaScript files be

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.