Articles of binary

A serious problem in Bijection in a Algo

If you have seen this part before, ignore the first part and jump to “Change of the algo here” section In this post I gave this following Algorithm to generate every element of $2^{\mathbb{N}}$ with given a value $x\in \mathbb{R}_{[0,1)}$ let $x\in \mathbb{R}_{[0,1)}$. If $x=1$, then note that $1_{10}=0.\dot{9}_{10}$ and $0.\dot{9}_{10}=0.\dot{1}_2$ Otherwise calculate $2x$, if […]

Odd and even numbers in binary system

Actually here is a basic question, but i have a little problem about it. In binary system, for any number such as 1011001, can we say directly “it is end with 1, so it is an odd number”?, or firstly should we convert it to decimal form, then look for is it odd or even […]

Number of 'unique' one bit binary functions with N-bit inputs

Consider the set of binary functions that takes an N-bit input -> 1 bit output. There are 2^(2^N) elements in this set. Now potentially reduce this set by restricting to only considering functions which have a dependence on every input bit (ie. there is no bit such that inverting the bit on the input never […]

Calculating CRC by long division: How to decide the top number of long division?

Ok, I know how to use long division by using regular numbers, but when comes to binary numbers I’m getting confused. In following calculation I can see the equation solved but I don’t understand where the top number came from. How to decide what bit goes on top while doing this? PS. We are doing […]

Floor function to the base 2

I’m not a math guy, so I’m kinda confused about this. I have a program that needs to calculate the floor base $2$ number of a float. Let say a number $4$, that base $2$ floor would be $4$. Other examples : $5 \to 4$ $6 \to 4$ $8 \to 8$ $12 \to 8$ $16 […]

How many ways I can permute the $n$ digits binary without counting the neighboring $1$s?

I know it is possible to count the number of reinterpretations of ones and zeros in binary of any given digit using the simple law $2^n$, but I want to remove the duplicate count where $11$, or $111$ is present. Only $1010$, $01$, $0101$ but not $0110$. I mean no double $1$s should neighboring each […]

Determining the position of a binary value with $k$ one bits and $n-k$ zeros in an enumeration of $C_k^n$ bit strings

I first enumerate a list of all possible binary strings for a length $n$ (e.g., [“00”, “01”, “10”, “11”] for $n=4$). This leads to a list of $2^n$ binary strings. Within that list of $2^n$ elements, I’m principally interested in the $C_k^n$ combinations of strings, for example all binary strings with a single bit set […]

What is the relation between this binary number with no two 1 side by side and fibonacci sequence?

I saw this pattern of binary numbers with constraints first number should be 1 , and two 1’s cannot be side by side. Now as an example 1 = 1 10 = 1 100,101 = 2 1000,1001,1010 = 3 10000,10001, 10010, 10100, 10101 = 5 Strangely I see the numbers we can form of this […]

Binary long division for polynomials in CRC computation

I am trying to learn binary long division, and I am confused. An example in my book gives that $10011010000/1101 = 11111001$ plus a remainder of $101$, which doesn’t make sense, since $1001$ is not divisible by $1101$, and so the first digit should be $0$. When I use an online calculator, it gives me […]

Converting $\frac{2}{7}$ to a binary number in a $32$ bit computer

I want to convert $\frac{2}{7}$ to a binary number in a $32$ bit computer. That is, $1$ bit is assigned to the sign of the number, $8$ bits are assigned to the exponent, and $23$ bits are assigned to the mantissa. So $x = \pm q \times 2^{m}$ where $\frac{1}{2} \leq q < 1$ (if […]