# Questions tagged [binary]

Questions related with (base 2) representation of numbers and their unique properties arising out of number representation.

1,670 questions
Filter by
Sorted by
Tagged with
45 views

### Need help on developing a algorithm for encoding a color with less than 24 bits.

The RGB encoding uses 3 8-bit numbers to encode any color , however I suspect that we may need even less than 24 bits.Here are my thoughts so far.The first number will tell the GCD of the values of ...
1 vote
49 views

I am reading a proof that the set of all binary strings is countable- it justifies this by mapping each binary string to the natural number it represents in binary. However, I am not seeing how this ...
72 views

### Order in a subset

Lets consider a range of "K" binary digit numbers. In that range, we want to take a subset of those values which have (<="n" consecutive 0s) AND (<="n" consecutive ...
1 vote
323 views

### How to find the amount of binary sequences with at least one "0" in the middle of 2 "1"?

This is a sub problem that I found while trying to solve one question from the programming marathon (please don't give me the direct solution for that. I am having fun solving these sub problems) If ...
106 views

### Number of ways to write integers in balanced binary

Imagine a method of writing integers which is similar to balanced ternary, except as you write more digits, their value increases by a factor of 2, not 3. For the remainder of the post, I will call ...
49 views

### Closed form or formula for the $n$-th binary number with m-bits that has at most k ones

Like the title suggests, I need the $n$-th number, not the number of numbers that answer that criterion. For example, for $m=4$ and $k=2$ the formula should equal $0,1,2,3,4,5,6,8,9,10,12$ as $n$ ...
1 vote
39 views

### The number of binary digits is less than the value

I want a proof that the number of binary digits is less than the value. There is a log relationship $$base_{digits} = \log_2(value) + 1.$$ I can't seem to prove $base_{digits}<value$. Or perhaps ...
63 views

1 vote
104 views

1 vote
66 views

### A question regarding the construction of binary sequences

Suppose we want to find all binary sequences with a length $K$ that contain $N$ ones. We know that the number of such sequences is $P = K$ choose $N$. As an example, for $K=4,N=2$ we get the following ...
1 vote
120 views

### Number of guesses binary search would take to reach number

Essentially, given a start of an inclusive integer range $s$, an end of the range $f$ such that $s \le f$, and an integer $n$ such that $s \le n \le f$, how many guesses would binary search take to ...
53 views

### crc table lookup not giving the same result as basic implementation

The basic implementation of CRC uses XOR and left-shift operations to find the remainder. While the index of the leftmost bit of the remainder is greater than the degree of the generator polynomial, ...
154 views

### How do I find the nth number that has two 1's in its binary representation?

I'm trying to find the a closed-form equation for the nth number that has exactly two 1's in its binary representation. The first few numbers are 3, 5, 6, 9, 10, 12, 17, 18, and so on. My first ...
28 views

### How to do $-(1100.1)_2 - (1.010)_2$ using 1's complement

Convert $A = (12.5)_{10}$ and $B= (1.45)_{16}$ into binary format employing 6 bits for the integer part and 3 for the fractional part, including the sign bit. Perform $- A - B$ using 1's complement ...
366 views

### Division of binary numbers, confusing

I am trying my best to divide the following: Perform the following computations in binary arithmetic (Show how you perform the computations): My attempt: I watched: https://www.youtube.com/watch?v=...
124 views

### HMMT 2014 #9, how many times has Lucky performed the procedure when there are 20 tails-up coins?

There is a heads up coin on every integer of the number line. Lucky is initially standing on the zero point of the number line facing in the positive direction. Lucky performs the following procedure: ...
1 vote
29 views

### Doubt on complexity of multiplying two binary numbers.

In one of my lectures, it was stated that when we multiply two binary numbers (say $n$ and $m$) such that $n$ has $k$ bits and $m$ has $l$ bits we have a maximum of $kl$ bit operations. I don't ...
1 vote
45 views

117 views

### Number of flips on a binary string to get m consecutive 1s

I am thinking about a deceptively simple problem, at least for my admittedly poor statistics standard. A $k$ long binary string of all $0$s is given. A random element is chosen, and flipped. What is ...
102 views

### Possible connection between binary numbers and $\pi$

Here is the Desmos if you want to follow along: https://www.desmos.com/calculator/b4vtzruupm In messing around with binary numbers, I created a function $f(x)$ in Desmos that generated a list of ...
1 vote
### Prove that the sets $s_i := \{1\leq j \leq m: (i-1)\odot j = 1\}$ form a $\dfrac{1024}{2047}$-good subset of $T_{2047}$ of size $2048$.
Let $m$ be a positive integer, and let $T_m$ denote the set of all subsets of $\{1,\cdots, m\}$. Call a subset $S$ of $T$ $\delta$-good if for all \$s_1, s_2\in S, s_1\neq s_2, |\Delta (s_1, s_2)| \ge \...