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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:48:54+00:00 2026-06-10T23:48:54+00:00

I have N binary sequences of length L, where N and L maybe very

  • 0

I have N binary sequences of length L, where N and L maybe very large, and those sequences maybe very sparse, say have much more 0s then 1s.

I want to select M sequences from them, namely b_1, b_2, b_3…, such that

b_1 | b_2 | b_3 ... | b_M = 1111...11 (L 1s)

Is there an algorithm to achieve it?

My idea is:

STEP1: for position from 1 to L, count the total number of sequences which has 1 at that position. Name it ‘owning number’

STEP2: consider the position having minimum owning number, and choose the sequence having the maximum number of 1s from the owning sequence of that position.

STEP3: ignore the chosen sequence, update owning number and go back to STEP2.

I believe that my method cannot generate the best answer.

Does anyone has a better idea?

  • 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-10T23:48:56+00:00Added an answer on June 10, 2026 at 11:48 pm

    This is the well known set cover problem. It is NP-hard — in fact, its decision version is one of the canonical NP-complete problems and was among the 21 problems included in Karp’s 1972 paper — and so no efficient algorithm is known for solving it.

    The algorithm you describe in your question is known as the “greedy algorithm” and (unless your problem has some special features that you are not telling us) it’s essentially the best known approach. It finds a collection of sets that is no more than O(log |N|) times the size of the smallest such collection.

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

Sidebar

Related Questions

Let's say you have a List<List<Boolean>> and you want to encode that into binary
Let's say I have a binary vector of length N, and I'm looking for
i have a binary file which has 4 KB of header information and then
I have a binary tree where each node can have a value. I want
I have a Binary tree for a mathematical expression(infix), i want to convert directly
Say I have a binary number 01100 = 12 , what's an efficient way
Suppose I have five binary files on disk. These five files encode sequences of
I have a large data set of nucleotide sequences (long strings simply put) which
I have a series of binary number sequences as indicator variables. For example this
I have binary data in my database that I'll have to convert to bitmap

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.