Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
A problem related to maximum the number of bit-1 in binary numbers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
WU Chehai  
View profile  
 More options Apr 16 2006, 5:21 am
Newsgroups: comp.theory
Followup-To: comp.theory
From: "WU Chehai" <wuche...@gmail.com>
Date: 16 Apr 2006 02:21:40 -0700
Local: Sun, Apr 16 2006 5:21 am
Subject: A problem related to maximum the number of bit-1 in binary numbers
Hi,ALL
My problem is: I have N binary numbers and each number has L bits. I
want choose M numbers  from the N numbers(M < N), so that the bitwise
OR result of the M numbers has the maximum number of bit-1.
For example, I have three binary numbers: 010, 001, 101 and I want to
choose two of them. Obviously, I should choose 010 and 101, becase 010
bitwise OR 101 is 111 which has three bit-1's and other pairs, such as
010 and 001, 001 and 101, can only generate two bit-1s by bitwise OR.

Is this problem NP-hard?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alan Johnson  
View profile  
 More options Apr 16 2006, 8:21 am
Newsgroups: comp.theory
From: Alan Johnson <ala...@no.spam.stanford.edu>
Date: Sun, 16 Apr 2006 05:21:05 -0700
Local: Sun, Apr 16 2006 8:21 am
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers

WU Chehai wrote:
> Hi,ALL
> My problem is: I have N binary numbers and each number has L bits. I
> want choose M numbers  from the N numbers(M < N), so that the bitwise
> OR result of the M numbers has the maximum number of bit-1.
> For example, I have three binary numbers: 010, 001, 101 and I want to
> choose two of them. Obviously, I should choose 010 and 101, becase 010
> bitwise OR 101 is 111 which has three bit-1's and other pairs, such as
> 010 and 001, 001 and 101, can only generate two bit-1s by bitwise OR.

> Is this problem NP-hard?

Hint: Consider a 3SAT problem with L clauses, each clause corresponding
to a bit position in 3 L-bit numbers.  If you solved the above problem
with 3 such numbers, what would it tell you if you got 111 as the
result?  What if you got something other than 111?

Alan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
WU Chehai  
View profile  
 More options Apr 16 2006, 10:35 am
Newsgroups: comp.theory
From: "WU Chehai" <wuche...@gmail.com>
Date: 16 Apr 2006 07:35:12 -0700
Local: Sun, Apr 16 2006 10:35 am
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers
Thanks, Alan
I can have a bool variable e(i) for the ith binary number: e(i)=1 means
the ith number is chosen and e(i)=0 means otherwise. So, every bit
position can be expressed by a clause which has at most i variables.

MAX-SAT is very similar to this problem, but MAX-SAT does not restrict
the number of true bool variables. In my case the number of ture
variables (how many e(i) is true, 1<= i <= N) must be M.

I am wondering whether I can get a reduction from MAX-SAT. I have been
working on this problem for weeks, I still get nothing now.
Am I on the right way? Maybe this problem is in P?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
subbu  
View profile  
 More options Apr 17 2006, 1:47 pm
Newsgroups: comp.theory
From: "subbu" <subramanya....@gmail.com>
Date: 17 Apr 2006 10:47:27 -0700
Local: Mon, Apr 17 2006 1:47 pm
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers
A simpler reduction would be from set cover.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
WU Chehai  
View profile  
 More options Apr 17 2006, 11:26 pm
Newsgroups: comp.theory
From: "WU Chehai" <wuche...@gmail.com>
Date: 17 Apr 2006 20:26:28 -0700
Local: Mon, Apr 17 2006 11:26 pm
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers
Thanks very much, subbu
I think your idea works!
The binary numbers can be viewed as sets.
My problem is to find at most M sets to cover as many elements(bit-1)
as possible.
If I assume the OR result of all the binary numbers is all bit-1's, my
problem is SET-COVER.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David  
View profile  
 More options Apr 18 2006, 12:33 am
Newsgroups: comp.theory
From: David <d...@cs.mu.OZ.AU>
Date: Tue, 18 Apr 2006 04:33:02 GMT
Local: Tues, Apr 18 2006 12:33 am
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers
In <1145179300.551483.76...@e56g2000cwe.googlegroups.com> "WU Chehai" <wuche...@gmail.com> writes:

>Hi,ALL
>My problem is: I have N binary numbers and each number has L bits. I
>want choose M numbers  from the N numbers(M < N), so that the bitwise
>OR result of the M numbers has the maximum number of bit-1.
>For example, I have three binary numbers: 010, 001, 101 and I want to
>choose two of them. Obviously, I should choose 010 and 101, becase 010
>bitwise OR 101 is 111 which has three bit-1's and other pairs, such as
>010 and 001, 001 and 101, can only generate two bit-1s by bitwise OR.
>Is this problem NP-hard?

Are you concerned with the complexity with respect to L or not?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
WU Chehai  
View profile  
 More options Apr 18 2006, 2:25 am
Newsgroups: comp.theory
From: "WU Chehai" <wuche...@gmail.com>
Date: 17 Apr 2006 23:25:16 -0700
Local: Tues, Apr 18 2006 2:25 am
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers
I am concerned with N and M. L can be a constant.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David  
View profile  
 More options Apr 18 2006, 3:19 am
Newsgroups: comp.theory
From: David <d...@cs.mu.OZ.AU>
Date: Tue, 18 Apr 2006 07:19:09 GMT
Local: Tues, Apr 18 2006 3:19 am
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers
In <1145341516.922947.164...@i40g2000cwc.googlegroups.com> "WU Chehai" <wuche...@gmail.com> writes:

>I am concerned with N and M. L can be a constant.

Surely in that case it's polynomial, since M is at most L.
Just examine the O(N^M) possible combinations of M numbers to
find a set whose OR has the maximal number of bits set.

I suspect there are much more efficient algorithms.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
WU Chehai  
View profile  
 More options Apr 18 2006, 5:37 am
Newsgroups: comp.theory
From: "WU Chehai" <wuche...@gmail.com>
Date: 18 Apr 2006 02:37:16 -0700
Local: Tues, Apr 18 2006 5:37 am
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers
M has little to do with L.
M should be less than N.
So, we have C(N,M) possible combinations. This is not polynomial.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David  
View profile  
 More options Apr 18 2006, 9:27 am
Newsgroups: comp.theory
From: David <d...@OMIT.cs.mu.OZ.AU>
Date: Tue, 18 Apr 2006 13:27:01 GMT
Local: Tues, Apr 18 2006 9:27 am
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers
In <1145353036.079482.110...@j33g2000cwa.googlegroups.com> "WU Chehai" <wuche...@gmail.com> writes:

> M has little to do with L.
> M should be less than N.
> So, we have C(N,M) possible combinations. This is not polynomial.

As I said, M is at most L, which is a constant, so it is polynomial.

Consider some solution: a set of numbers whose OR has at most L 1's.
Each number must contribute at least 1 distinct 1 bit, or it is
redundant and can be removed without affecting the maximality of
the solution. So M need never be greater than L.

Of course if you insist on exactly M numbers in a solution rather
than at most M numbers, and M > L, you can add any numbers you like
to a solution just to pad it out, but these can be chosen arbitrarily.
To find a solution you need consider only O(N^L) combinations.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
WU Chehai  
View profile  
 More options Apr 18 2006, 10:26 am
Newsgroups: comp.theory
From: "WU Chehai" <wuche...@gmail.com>
Date: 18 Apr 2006 07:26:58 -0700
Local: Tues, Apr 18 2006 10:26 am
Subject: Re: A problem related to maximum the number of bit-1 in binary numbers
David, I know what you mean.
L should be taken into consideration when we analyze the complexity

My problem is in fact the same as MAXIMUM COVERAGE
PROBLEM(http://www.ensta.fr/~diam/ro/online/viggo_wwwcompendium/node146.html),
which is known to be NP-Hard. So I think the problem is NP-Hard.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »