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

learn more… | top users | synonyms

0
votes
1answer
20 views

decimal to binary conversion of recurring decimal numbers in matlab

I have made a function convert fractional part of a decimal number to binary, the code is given below: ...
1
vote
2answers
57 views

Subtracting Binary Numbers with one and two's complement

An example: $01001 - 11010 = -10001 = -17$ one's complement: $00101$ two's complement: $00110$ so the above statement should evaluate the same as: $01001 + 00101 = 01110$ (inverting it) $= 10001$ ...
0
votes
2answers
26 views

why shifting left 1 bit is the same as multiply the number by 2

I have recently faced a problem .The problem is here.We know that if we represent a decimal number in binary and move left all the bits by one. The left most bit is lost! and at the rightmost, a zero ...
0
votes
1answer
18 views

Retrieve position from binary number ordered by number of ones

I have binary numbers of length s. They are ordered by numbers of ones, and they can have at most j zeros. That is: first are ordered all numbers containing (s; 0) possible subsets of s numbers, next ...
0
votes
1answer
29 views

Prove by induction the number of edges in a tree given the leaves.

Define a cs130A tree to be a single leaf node or an internal node (the root) connected to two disjoint subtrees, which are themselves cs130A trees. Prove by induction that for all cs130A trees the ...
0
votes
1answer
21 views

Find what row a given number exists in within a binary heap tree.

If I have a binary heap tree like so: 1 2, 3 4, 5, 6, 7 8, 9, 10, 11, 12, 13, 14, 15 16 ... 31 32 ... 63 64 ... 127 I ...
1
vote
0answers
49 views

Probability of having n more 0's than 1's in a subsequence

We have a number K>2 and a sequence of m binary values $$b_1, ... b_m $$ Given a subsequence $$b_i, ... b_j, i>j $$ we define: W(i,j) is the number of 1's in the sequence L(i,j) is the number ...
0
votes
1answer
22 views

Determining if the result of adding (subtracting) two binary numbers is correct as NBC and 2's

My task is to convert two numbers to binary, add them and determine if the result is correct as a NBC and 2's. Then I have to subtract B from A by converting by using 2's for calculating -B [that is A+...
4
votes
2answers
105 views

Integers with consecutive nonzero digits in base 2

Note that $2016=11111100000$. How many integers $\le n$ have their nonzero bits consecutive in their binary (base $2$) expansion? The case $n=2^m-1$ is easy. The question is about a closed formula for ...
1
vote
1answer
59 views

Binary subtraction with borrowing vs. 2's complement

Consider the following two binary numbers which are using sign-magnitude representation. Therefore, both are positive numbers. ...
0
votes
0answers
59 views

Two's complement involving binary numbers [Single-precision floating point number]

Given the following bit pattern: 0010 0100 1001 0010 0100 1001 0010 0100 What decimal number does it represent, assuming it is a single-precision floating point number?
-3
votes
1answer
72 views

Two's complement involving binary numbers [closed]

$$0010\ 0100\ 1001\ 0010\ 0100\ 1001\ 0010\ 0100$$ What decimal number does it represent, assuming it's a two’s complement integer?
0
votes
0answers
151 views

Designing a Turing machine for Binary Division

I'm trying to design a TM to binary divide 2 numbers. The best approach I've found is the method: division as repeated subtraction, but I don't know if there's a fastest way or an easier way. ...
0
votes
1answer
42 views

Find a function comparing two variables that is equal to 1 when they are equal and 0 when they are not

I am trying to find a function that compares two variables. When these two variables are equal, the function should equal 1. For any other value, the function should equal 0. Is there a way to do this ...
0
votes
0answers
10 views

Proof by induction that $\sum \limits _{i=1} ^n d^{-l_i} = 1$ sentence in a full tree [duplicate]

How do I prove by induction that $\sum \limits _{i=1} ^n d^{-l_i} = 1$ where: $d$ = the number of children of each node; $n$ = the number of leaves; $l$ = the depth of each leaf $l_1, \ldots, l_n$? ...
-2
votes
3answers
81 views

Generating binary array

Programming side (C++) I have this task where I need to get 5 numbers in binary array, but i cant think of way to generate it. The building process is: Starts Width 10 then adds same number but 1 ...
1
vote
1answer
20 views

Convex or Quasiconvex Relaxed Binary Quadratic Optimization Problem

Let's say I have a quadratic problem with nonnegative triangular matrix Q and binary decision variables x. $$min_{x} f(x) = x^\...
2
votes
2answers
91 views

Binary number with base $-2$ (minus two) arithmetic algorithm

I have a number X represented as a sequence of $a_i \in {0,1}$ so $$X = \sum_{i=0}^{N-1} a_i(-2)^i$$ where $N \in \{ 1, \ldots, 100000 \}$. I need to find an algorithm to produce a number $Y = -X$ ...
1
vote
0answers
29 views

largest number machine number that this comp has, numerical analysis, mantissa

I am having trouble understanding the basics on how to calculate the m, s and c of the formula. I have looked in my textbook but not much of an explanation, also on the IEEE websites but nothing much. ...
1
vote
2answers
25 views

Formulating the bitwise OR operation

Considering the bitwise OR operation, wikipedia states, $$x\;\mathrm{OR}\;y = \sum_{n=0}^b 2^n\left[\left[\left(\lfloor\frac{x}{2^n}\rfloor\mod2\right)+\left(\lfloor\frac{y}{2^n}\rfloor\mod2\right)...
0
votes
0answers
8 views

How would I round the number $-(1.01101|01)_2$ down?

I'm trying to round $-(1.01101|01)_2$ in binary down. The $|01$ are the guard bits. The answer is $-(1.01110)_2$ My attempt is as follows: $-(1.01101|01)_2$ $-(0.00001|00)$ = $(1.01100)$ Not ...
0
votes
1answer
81 views

How many 10-bit binary sequences begin and end with the same bit?

Can you please teach me how to solve this? There are other similar questions that I have, but I don't understand how to solve them. Another question is: How many 10-bit binary sequences contain an odd ...
1
vote
1answer
43 views

Binary variable in a constraint

I have the following optimization problem: Model I: $$f(x,y) \\ s.t., \\ y\leq x+M(1-V)\\ y \leq MV \\ x \geq 0, y \geq 0$$ where x and y are continuous variables whereas V is a binary variable. M ...
0
votes
2answers
35 views

About 2-adic representation of integers

How would I express -3 in 2-adic representation? Is it just revercimal calculation of binary expression of -3? like: -3 = -11 in binary, so using revercimal, -11. in binary = 01. ?
0
votes
1answer
73 views

Prove that the set of all binary sequences is uncountable

Question: Prove that the set of all infinite binary sequences is uncountable. Comments: I think that there are a couple of ways of going about this. My first approach was to show that the set of all ...
3
votes
1answer
59 views

Proof that max value of $n$-bit binary number is $2^n - 1$

After reading this programming question , I wanted to prove the assertion. I'm wondering whether the below would be considered a complete and clear proof. Claim: $\sum_{i=0}^{n-1} 2^i = 2^n - 1.$ ...
5
votes
7answers
649 views

How to find the unique sums in the values 1,2,4,8,16, 32

I apologize but I'm not sure what you would even call this problem. I have some data that provide a numeric code for race as follows: hispanic(1) + american_indian_or_alaska_native(2) + asian(4) + ...
0
votes
1answer
37 views

What actually determines a 'borrow' in binary subtraction?

Given Byte1 and Byte2 in binary. How to determine whether Byte1 - Byte2 results in a borrow ...
0
votes
0answers
18 views

Is it possible to break a system into two BSCs to find the total capacity of a system?

I have been trying to solve this problem in manor of ways but I cannot seem to find a satisfactory solution. I have tried the basic way of calculating capacity through self information but I was ...
1
vote
0answers
20 views

How to perform binary transformations?

One of the steps in Binary Index Tree algorithm is to find a node's parent which is done by un-setting the rightmost SET bit. For example: if a node has index 1010 than it's parent is 1000. To apply ...
1
vote
1answer
130 views

How many binary numbers of length n do not contain the substring 000?

How many binary numbers of length $n$ do not contain the substring $000$? Denote this number by $Z_n$; find a relationship between $Z_n$, $Z_{n-1}$, and (something else not given) to form an ...
0
votes
0answers
35 views

How to find the number of subsets with a given length and XOR?

I have A (0<A<500000) elements (up to 10^6) in the set. I need to find in how many ways can I remove a subset, the size of ...
1
vote
1answer
46 views

Why not, first order logic to DNF conversion?

There seems to be huge amount of discussion about converting "first order logic to CNF". But don't see much about "first order logic to DNF" conversion. What is the reason?
2
votes
1answer
211 views

Proof/intuition that any number can be expressed in binary form and every number will have a unique representation?

I was just thinking lately that how do we know that literally every number can be expressed in binary? And that too, with a unique representation? Clarification: With numbers, I mean whole numbers. ...
2
votes
0answers
118 views

Bounding the global intersection of a family of sets

Suppose that we have a decision tree of height $r + 1$ that describes how to increment an $n$-bit integer in the range $[0, 2^n -1]$. That is, the internal nodes are labelled with a bit position that ...
1
vote
2answers
49 views

Prove a map of binary expansion is continuous

Prove that the map: f: $\{0,1\}^\mathbb{N} \times \{0,1\}^\mathbb{N}$ $\to$ $[0,1] \times [0,1]$ is continuous. I know that the map can be written as ($m_1,m_2,m_3,m_4,...$) $\times$ ($n_1,n_2,n_3,...
4
votes
0answers
42 views

Is there a way to approximate a polynomial as another, binary-coefficient polynomial?

Let's say I have a polynomial: $$p(x) = \sum_{n=0}^N a_n x^n$$ where $x \in \mathbb C$. Does there exist theory and/or methods on approximating $p$ as: $$p(x) \approx \hat p(x) = \sum_{m=0}^M b_n x^m$...
3
votes
0answers
90 views

Is there any kind of known pattern to $\sqrt 2$ in base 2?

Is there any kind of known pattern to $\sqrt 2$ in base 2? Is there any classification categories for decimal digits of numbers that for example would put $\sqrt 2, \sqrt 3 \cdots \sqrt n$ into ...
0
votes
2answers
28 views

Trouble understanding binary representation of numbers

"If $x\in[0,1]$, we will use a repeated bisection procedure to associate a sequence $(a_n)$ of $0$s and $1$s as follows. If $x\neq\frac{1}{2}$ belongs to the left subinterval $[0,\frac{1}{2}]$ we take ...
0
votes
0answers
16 views

How to add two negative binary numbers

Solve the following using two's complement binary numbers: $ (-111)_{10}-(110)_{10}=?$ $(-111)_{10}=(10010001)_2$ with 2s complement $-(110)_{10}=(10010010)_2$ with 2s complement But $10010001+ ...
0
votes
2answers
45 views

How to compute two's complement of a negative number?

I made the search on here and on google and couldn't find anything that answered the topic title. From my bit of understanding, two's complement can be used to make a decimal number, negative. Which ...
0
votes
0answers
28 views

Binary tree for sorting combinations

Let's imagine to have a binary n-array as input. All the possible combinations for this n-array will be 2^n. Right? Now, I want to put these combinations in a specific order. In particular, I want "0,...
1
vote
0answers
40 views

Finding a Hamiltonian cycle for $Q_4$

A hyper cube $Q_n$ is a graph that have the length-n binary sequences as its vertices. Two vertices are adjacent if they differ in one entry. I found a Hamilton cycle for $Q_3$ as follows $$000 \to ...
0
votes
1answer
63 views

Probability random binary number lies in an interval

Suppose we have a sequence $\{d_n\}$ where all the $d_n$ are either 1 or 0, with equal probability. Let $x=\sum_{n=1}^\infty d_n2^{-n}$. I need to show that $\mathbb{P}(x \in [a,b])=b-a$. I started ...
0
votes
2answers
55 views

How do you add 8-bit floating point with different signs?

Hi I have some trouble with how should I add two 8-bit floating points with different signs. The question is here, 1 100 1100 + 0 101 1011 = Thee 1st bit is the sign, next 3 bits are the exponent ...
0
votes
1answer
20 views

Binary symmetric channel

Binary symmetric matrix A sends $i,j$ and B gets $i,j$. Does it mean that $A$ != $B$? I would know how to solve this if A would be equal to B, but now I'm not sure how should I start, when A has 2 ...
1
vote
0answers
19 views

binary divison with remainder

I wanted to calculate this (binary): 10101.101/1.1. the result is: 1110.01101010101010101010101010... I succeed in calculating the integer part, but I didn't understand how I find the numbers that ...
0
votes
0answers
135 views

Reciprocal of a binary number

I'm looking for a way to compute the reciprocal of a binary number. The numbers are fractions, but that doesn't really matter. Therefore we can think of any number involved as $N \geq 0$. The idea is ...
0
votes
0answers
209 views

185 stored as a signed 8-bit number?

Several exercises in my textbook start with assumptions that confuse me. For example: Assume 185 and 122 are signed 8-bit decimal integers stored in sign-magnitude format. Assume 151 and ...
1
vote
1answer
72 views

What is the name for the binary sequence 0110100110010110?

This is a special sequence formed by: 0 0 + 1(its opposite) 01 + 10(its opposite) 0110 + 1001(its opposite) 01101001 + 10010110(its opposite) What is it called?