Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [binary]

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

-1
votes
1answer
18 views

Is the dimension of a binary linear code the number of codewords it contains? [on hold]

For example, would the dimension of the binary linear code $\{0000,1111\}$ be $2$?
1
vote
1answer
27 views

Finding similarities between binary strings

I have been tasked with this puzzle for my programming class, it's purely a puzzle and doesn't count towards any grades, but not being able to solve it is really bugging me! We have been given two ...
1
vote
1answer
20 views

Prove that the mapping of a number to its XOR with some constant c is bijective

Prove that $x \mapsto x \oplus c$ is a bijection over the range $[0, b]$, regardless of the value of constant $c$, where $b = 2^{k} - 1, k \in I^{+}$.
0
votes
0answers
19 views

Understanding Weird Relationship Between Hamming Weights

I have two binary "mapping" matrices $\delta_0$ and $\delta_1$ $ \delta_0 = \begin{bmatrix} 1 0 1 0 0 0 0 0\\ 1 1 0 1 1 1 1 0\\ 0 0 0 0 1 1 0 0\\ 0 1 1 1 0 0 0 0\\ 0 1 1 0 1 0 0 0\\ 1 0 0 1 1 1 0 0\...
2
votes
0answers
79 views

What is known about evil primes?

An evil number is a positive integer $n$ that has an even number of $1$s in its binary expansion. Many theorems exist about evil numbers, the most known ones are probably those that involve the Thue-...
1
vote
1answer
42 views

Prove that for every $n$, the binary representation of $n + 1$ contains exactly one bit that flips from $0$ to $1$

I know since $n$ is a binary representation it can be represented $ \sum_{i = 0}^{p}b_{i}\cdot 2^{i}$, where $b_{i}\in \{0,1\}.$ I have the intuition for this problem, i think. If $n$ is odd then the ...
0
votes
1answer
34 views

Distance of binary strings to produce the lexicographical order

Indexing objects like elements of a Cantor Set or nodes of a Binary Tree can result in a enconding system of binary strings like illustrated bellow: The illustrated indexes form a finite set, $$C_3=\...
0
votes
0answers
15 views

Modulo 2 to real domain [closed]

I have three matrices $r$ of size $1\times n$, $G$ of size $k \times n$ and $x$ of size $1 \times k$. All of the matrices are binary, the entries are either 1 or 0. I have the following quantity in ...
0
votes
0answers
34 views

Rank of two binary matrices

Let $N=2^n$. Consider two matrices $M,P$ over $GF(2)$ where $M$ is a circulant matrix of size $(N,N)$. Matrix $P$ is of size $(N,N+1)$. All values of $P$ are same as $M$ except last column. Also $P_{1,...
0
votes
0answers
26 views

How to choose a set of boolean functions with a specified probability of getting a 1

So let's say I have a boolean function $f(x)$ that takes in a size k binary vector and outputs a binary scalar. Each function is defined as a $2^k$ vector. For example $f((0,0)) = 0, f((0,1)) = 1, f((...
0
votes
0answers
37 views

Proving by induction of binary number.

If n is binary represented natural number, P(n) for some predicate P. This is just a sample question I made. Base case) Let n = 0. This is divisible by 2 Induction step) Let n = k is a binary ...
0
votes
2answers
18 views

Converting Large Decimal Numbers to Octal and Binary

I have large numbers that I need to convert to Octal and Binary systems. Examples of numbers that I am working with are $10^{10}$, $10^{20}$, $10^{30}$ ... (powers of 10) and numbers that are ...
1
vote
0answers
23 views

Need to clarify 1 / LN(2) in binary representation

I want to represent 1/LN(2), 1.442695041 in 32 bits binary. I found that must be 1.0111000101010100011101100101001, but a work collegue insists it needs to be shifted right and add an integer of "1", ...
0
votes
0answers
35 views

Determine whether an integer can be constructed from other integers by applying bitwise AND and OR operations

Given binary numbers $b_1, b_2, ... , b_m < 2^n$ as well as their complements $b'_1, b'_2, ..., b'_m$ (with leading $1$'s if necessary, such that $b_i + b'_i = 2^n - 1$), is it possible to quickly ...
1
vote
1answer
29 views

How to find shorter encoding of $256$ bit number

Wondering if you could encode a number such as $2^{256}$, as a polynomial equation or some other encoding that would make it shorter than its actual value written out in decimal notation which is ~70 ...
0
votes
0answers
29 views

Solving for a and b from xor and difference

Can we solve for a and b, from $a-b = x$ $a \oplus b = y$ Even when x and y can be negative? I tried substituting the value of a in xor equation from the ...
0
votes
1answer
22 views

How to detect if binary number divides by 3 if transmitted MSB first

How to detect if a sequence of bits, transmitted MSB first, divides by 3 ? The FSM in below question solves the problem if LSB first. FSM doesn't seem to work because adding '0' bit to left of number ...
0
votes
1answer
18 views

How to calculate binary tree node number and layer number generated from $10^{100}$

Trying to learn about calculations related to binary trees, and would like to know how many binary tree node layers there are in a binary tree generated from $10^{100}$, and more generally, how to ...
0
votes
1answer
50 views

If you can cram any more than $2^n$ unique, obtainable values into a binary string [closed]

When you typically talk about binary strings, you basically say that they have $2^n$ values. So 10 is 2, 11111111 is 255, etc. ...
1
vote
0answers
63 views

How many different relationships of couple's acquaintances exist in the company of N persons

How many different relationships of couple's acquaintances exist in the company of N persons, if in each of the three of this company there are both familiar and not familiar persons Somewhat similar ...
0
votes
1answer
35 views

Subtraction With 8 Bit Integers

I have encountered the following question and I don't know how to approach it: "Perform the following subtraction by adding the 2's complement using 8 bit integers: 35-15=20"
0
votes
1answer
24 views

Encoding numbers from 0 to 255 using Huffman coding.

How can I encode numbers from 0 to 255 using Huffman coding (or any other code), so that each number (especially the largest numbers such as 255) wouldn't take 8 bits of binary space? In other words, ...
-1
votes
2answers
37 views

Stuck in something: How to write coordinates in one number?

I have a X, Y coordinate system which starts from 0 and ends in 255 on each axis. Thus, I can fit 65,025 numbers in it. Imagine each number as a pixel, so I have 65,0250 pixels in my coordinate system....
1
vote
2answers
24 views

Binary Combinations Less Repetition

What would the formula be for finding the number of combinations of $n$ binary elements when no $0$ can follow another but there is no restriction on subsequent $1$s. For example, an allowable ...
1
vote
0answers
21 views

Show that the set of numbers normal to base d has Lebesgue Measure 1 (d=2 and d=3).

I need to prove this for $d = 2, d= 3$. I'm working on $d =2$. The idea is to show that my $x_n$'s are IID so that I can apply the strong law of large numbers. Let $N_2 = \{x \in [0,1] \mid x\text{ ...
0
votes
3answers
53 views

Digits of a number between 0 and 1.

I'm currently working on a problem that requires me to know, for some $x=.x_1x_2x_3....x_n \in [0,1]$, when the $nth$ digit is equal to $0$ or $1$, in base $2.$ For example the interval where $x_1 = 1$...
0
votes
1answer
41 views

Fast parallel multiplication method

In page 6 of A very fast multiplication algorithm , how do the PAR-allel multiplication work ? Why is 12021011 equivalent to 299 ? Parallel Multiplication method
0
votes
1answer
78 views

Will the following sequence ever repeat?

I'm unsure if the notation used by the author is common, so I will define some terms before stating the problem. {$0, 1$}$^\infty$ is the set of all functions $f:\mathbb{N} \rightarrow ${$0, 1$}. {$...
0
votes
0answers
63 views

inverse of a binary matrix modulo 2

All operation are modulo 2. I want to calculate the inverse of a matrix. Is there any easy way to do that? I have tried the usual method of finding determinant and all that.
1
vote
2answers
31 views

How to rewrite a decimal number $x$ as $1.y\cdot2^{n}$?

If I have a number, let's say "$-77,51$", what is a good way to rewrite it as $1.y\cdot 2^{n}$?
0
votes
1answer
48 views

Why for two binary numbers $x,y$ is $\neg (\neg x + y) = x - y $ true?

Iv'e noticed, empirically, that for two integers $x$ and $y$ in binary representation (two's complement) it holds that $$\neg (\neg x + y) = x - y $$ Where $\neg$ is the bitwise "not" operation and ...
3
votes
1answer
120 views

Darboux continuity of the function $f(x) = \limsup_{n \to \infty} \frac{(x_{1}+…+x_{n})^{2}}{n^{2}}$

Let $f : [0,1] \to [0,1]$ be a function that assigns to each $x \in [0,1]$ the following value: $$ x = 0.x_{1}x_{2}x_{3} \ \ ... \hspace{0.3cm} \text{be the binary expansion of }x $$ define $$ f(x): ...
0
votes
1answer
29 views

Counting binary integers with a given number of zeroes

Problem: Let n be a positive integer. A number is randomly chosen from 1 to 2^n. The probability that it has exactly 6 zeroes in its binary representation is 1989/16384. What is n? Solution: For n≥7, ...
-1
votes
1answer
30 views

Digits of $3^n$ in base $2$

I am trying to find some sort of pattern in the base-$2$ representation of $3^n$; in particular, I would like to find formulae for the number of ones in the binary representation of $3^n$, or at least ...
1
vote
1answer
19 views

Binary relation finding the transitive closure

Let $A=\{a,b,c\}$ and the relation given by the following matrix: $\mathcal M_r=\begin{pmatrix}1&0&1\\0&1&0\\1&1&0\end{pmatrix}$ The task is to find the smallest transitive ...
0
votes
1answer
22 views

Find the binary input function given the outputs (part 2)

Here we have three binary variables $x_1$, $x_2$, $x_3$ $\in \{0,1\}$. I want to find the form of the function $f(x_1, x_2, x_3)$ such that the following are satisfied: if $\ x_1 = 0,\ x_2 = 0,\ ...
0
votes
0answers
33 views

Two's complement addition issue

In a two's complement system, 16-bit binary numbers $0010010010010010$ and $1111110011111100$ can be represented in the decimal system as $9362$ and $-772$, correspondingly. Now, from what I've read ...
0
votes
1answer
28 views

46- and 64-bit integers

Some Cray supercomputers used to support 46-bit and 64-bit integer data types. What are the maximum and minimum values that we could express in a 46-bit integer? in a 64-bit integer? Is my ...
0
votes
0answers
31 views

23-bit mantissa and 9-bit exponent range and precision

I have the following problem which I would like to make sure that I understand correctly. So I would appreciate your help in this matter. Some computers (such as IBM mainframes) used to implement ...
1
vote
0answers
49 views

Above $2^{106\cdot 17}$ in Tupper's “Self-referential” Formula

Tupper's so-called "self-referential" formula is a way to generate any 106x17 image for any $k$ provided that $\frac{k}{17} \in \Bbb Z^*$ (set of nonnegative integers). By taking any binary number, ...
2
votes
2answers
170 views

Sum of set bits in every element for a natural numbers

I was thinking of a mathematical puzzle with binary representation of numbers, but could not find a convincing answer myself. Here is the puzzle: Say for some number N, I want to find the sum of the ...
0
votes
0answers
33 views

Numerical Methods, Binary, and finding two nearby machine numbers

I have the question, Find the binary form of the number x = 2/7 Suppose that the number x = 2/7 is stored in a 32-bit computer. Find the two nearby machine ...
0
votes
2answers
41 views

Finding a binary prefix code provided lengths

Firstly, I am relatively new to this particular forum, and I usually use Stack exchange (maths). I do not know if this is the right place to post so please be aware in case, I should ask this question ...
1
vote
0answers
57 views

Linear combination using extended GCD

Trying out different implementations of the extended GCD, i found out that all of them return the same linear combination factors for $egcd(a,b)$ and $egcd(b,a)$. For example (with this algorithm) I ...
0
votes
2answers
37 views

Find the binary input function given the outputs

Here we have three binary variables $x_1$, $x_2$, $x_3$ $\in \{0,1\}$. I want to find the form of the function $f(x_1, x_2, x_3)$ such that the following are satisfied: if $\ x_1 = 0,\ x_2 = 0,\ ...
0
votes
1answer
11 views

$x = XOR(a_0, a_1, …\space a_n), \exists \space j \in [[0, n]] a_j \space xor (a_j - x) \space xor\space x = 0$, prove me right or wrong

I tell you that given any family of natural number: $$a_0,\space a_1,\space ...\space a_n$$ (of any finite lenght), posing $$x = XOR(a_0,\space a_1,\space ...\space a_n)$$ We have $$\exists\space ...
0
votes
0answers
23 views

Idempotents of binary cyclic codes

Let $e(x)$ be an idempotent in $R_n = \mathbb{F}_{2}[x]/\langle x^n - 1 \rangle$, where $n$ is odd. Let $\alpha$ be a primitive $n^{th}$ root ofunity in some extension of $\mathbb{F}_2$. I'm trying to ...
1
vote
4answers
395 views

Finding numbers by given XOR values.

Given XOR values of 3 indices how can we find the numbers? Like say if I have indices from 1 to 7, how can I find the numbers by given XOR values? I have: $X_{1} \oplus X_{3} \oplus X_{5}=V_1$ $X_{1}...
2
votes
2answers
206 views

Find the additive inverse of binary number

My online assembly class doesn't really show us how to find the additive inverse of finding the additive inverse of binary, and I can't find much online. The question is: find the additive inverse of ...
3
votes
2answers
162 views

Least and most significant bit calculation using bitwise operations

I am working on a project and I need to calculate the least significant bit (LSB) and most significant bit (MSB) of integers. Suppose $x$ is an $n$-bit unsigned integer ($n=16, 32$ or $64$). We know ...