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

learn more… | top users | synonyms

16
votes
3answers
2k views

Why are binary representations of huge numbers about $3.3218$ times as long as their decimal representations?

Why are huge binary nubers about $3.3218$ times longer than their decimal counterpart? I thought about this when I was writing this Python code: ...
1
vote
0answers
61 views

Generator polynomial creates a 127 bit sequence

I have been reading a paper that states that a generator polynomial $$ G(D)= 1+ D^4+D^7$$ creates a 127 bit sequence which is as follows 00001110 11110010 11001001 00000010 00100110 00101110 ...
0
votes
1answer
31 views

Generating binary palindromes

I have the following Number Systems problem. "Given the numbers from 2-2047 (inclusive) represented in binary, how many are palindromes? The leading digit can't be zero." How would I go about solving ...
5
votes
4answers
188 views

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 ...
4
votes
0answers
57 views

What is the explicit formula (solution) to this recursively defined binary matrix?

My question concerns the following binary matrix (call it matrix $A$). Or rather the entire family of such matrices, for some number of columns $n$ and rows $2^n$. The ellipses indicate that the ...
-4
votes
2answers
35 views

From Decimal to Octal [closed]

I have come across number between 0 and 65536. How can I convert this to octal? Do I convert it first to binary? Thank you very much
0
votes
3answers
89 views

converting to octal, hexadecimal and binary

Revising for an exam - could someone explain to me how you can convert an ordinary numbers to octal, hexadecimal and binary would be appreciated
0
votes
2answers
537 views

Quick logarithm calculation

In coming up with an algorithm for finding log (10) base 2, these are my thoughts. I wanted to know if this makes sense and how could I truly make it more efficient. The requirements are strictly not ...
7
votes
2answers
309 views

$N$ perfect logicians wearing hats

I once came across the following riddle: (assume $N$ to be extremely large) There are $N$ perfect logicians arranged in a vertical row. They are allowed to strategize before the game, during the ...
-1
votes
3answers
29 views

What is the easiest way to get the real representation number of a binary and vice versa? [closed]

2nd Question: If I was given a computable number say, 0.010101 and I was asked to find out what this binary number represents in real number - Would I simply ignore the 0. and just consider 010101 or ...
1
vote
1answer
22 views

calculation of binary power like $a^b$ where a,b are binary numbers

Is it possible to calculate power of binary number like $a ^ b$where a,b both are binary numbers.
1
vote
1answer
309 views

The maximum number of digits in binary multiplication

Given 2 binary numbers of n digits. (n can be from 1 to something large) What is the maximum number of digits of their product? I think it's 1 in 1-digit*1-digit, and 2n otherwise. But I want some ...
1
vote
2answers
48 views

Calculating all possible sums of the numbers $2^0, 2^1, \ldots, 2^{(n-1)}$

Using the simple equation $2^{n-1}$ you get answers such as: $1,2,4,8,16,32,64,128,256,$ etc. How can I find all possible number combinations within this range? For example, then numbers $1,2,4,8$ ...
0
votes
2answers
1k views

binary representation of a fraction in two's complement

Could any one please explain what is a 16-bit two's-complement representation of -0.375 and the steps to calculate it? Also, what happens if I convert it back to decimal? Thanks
-2
votes
0answers
39 views

How many unsigned binary numbers are there with 6 digits?

Given Base 2, 6 Digits (meaning 6 digits in Base 2), what is the Unsigned Range? Any help, with explanations would be really, really appreciated! Thanks for the responses thus far and I apologize ...
5
votes
5answers
86 views

How many bit strings of length $12$ have a substring $01$?

My question is should it be $11C2$ or should it be $11C1$? Since $01$ are connected together, I take them as a single unit and there are $11$ different positions where they can be placed. Is the ...
0
votes
0answers
16 views

Binary block code

I don't fully understand how i would construct binary block codes? As far as I know we have a code, say, $(5,4,3)-$code, then $5$ would represent the length, $4$ would represent the number of codes ...
0
votes
1answer
38 views

Probability of 2 n-bit binary strings lining up, given that the first k bits do so

There are two rows of 10,000 bits, one on top of the other, currently all set to 0. 00000000000000000... 00000000000000000... Now imagine that in each row, 40 of the bits are randomly flipped to a ...
0
votes
0answers
10 views

Is there a standard to follow when writing a weighted binary code (ex. 6-3-1-1 or 2-4-2-1)?

For example, in 6-3-1-1 code, 7 can be represented as 1001 or 1010. Similarly in 2-4-2-1 code, 6 can be represented as 1100 or 0110. My professor said that there is a standard to follow and there can ...
0
votes
1answer
26 views

A property of permutation codes

For $k\ge2$ and $M\ge k+2$ two integers, a permutation code matrix $C$ is a $\binom Mk\times M$ matrix which columns contain all distinct permutations of $M-k$ zeroes and $k$ ones. Page 44 of his ...
1
vote
4answers
853 views

How to find Bitwise AND of all numbers for a given range?

How can I find Bitwise AND of all numbers for a given range say from A to B, including both? I found a beautiful answer for finding XOR for such range. http://stackoverflow.com/a/10670524/2046703How ...
3
votes
2answers
80 views

How to populate a $0-$line with $1$'s?

I have a line of $n$ $0$'s like this: Zeroth index -->$000...000$ I want to populate the line with $m$ $1$'s with the following rules: (1) They have to occur after the index ...
1
vote
0answers
18 views

Learning Booth's Algorithm, I Can't Find the Issue on Final Result

I am practicing using Booth's Algorithm to multiply a positive number and a negative number (specifically the problem is $-12 \times 4$). I have included my attempt, but I can't find the issue. If ...
0
votes
3answers
34 views

Efficient algorithm for taking powers of binary numbers?

Is there any efficient algorithm for taking powers of binary numbers? Or even just squaring one? Thanks ahead of time.
4
votes
1answer
65 views

Why do we divide or multiply by 2 when converting binary?

Trying to understand the fundamentals of binary rather than just following steps, I wanted to know why do we multiply by 2 to convert a decimal (0.5, 0.25) to a binary and why do we divide by 2 when ...
0
votes
1answer
20 views

Division binary using polynomials

I want to do a division of two binaries and take the rest (mod). But I want to do this using polynomials, let's take the example: binary dividend: 010001100101000000000000 binary divisor: 100000111 ...
1
vote
0answers
31 views

Binary division using polynomial

I want to do a division of two binaries and take the rest (mod). But I want to do this using polynomials, let's take the example: binary dividend: 010001100101000000000000 binary divisor: 100000111 ...
2
votes
2answers
236 views

Longest sequence of 1s in binary representation of a number & Average Sequence length for number with N digits

I originally posted this to rec.puzzles in October 1992. I subsequently solved the problem (at least I think I did...) and published an article about it in early 1993. The article is nowhere to be ...
0
votes
1answer
36 views

Computing the Value of a minimax tree

I am asked to compute the value of a minimax tree, which each node labeled with its initial value. I am just unsure how to do it. I know that it is a minimax tree if: the root is a min node, the ...
0
votes
1answer
13 views

Writing a series of polynomial equations of certain degree from a sequence of binary bits using Magma

How do I write a series of polynomial equations of a specified degree from a sequence of binary bits using Magma. So far, I have the following code for converting a decimal sequence to binary. ...
0
votes
1answer
17 views

Probabilities of a Binary String

You generate a random $N$-bit binary string, and compute $X = \Sigma_1^N x_i$, where the $x_i$ are the $0$ and $1$ entries of the string. What is the probability that $X$ is odd, if $N$ is odd? What ...
0
votes
1answer
43 views

I'm trying to convert a number to binary. What am I doing wrong?

So I'm trying to convert a number to binary, but I keep getting the incorrect answer. If it matters I was roughly following this guide. Here is my work: $120 = 60 + 60$ $120 = 64 + 32 + 16 + 8$ ...
1
vote
1answer
63 views

the blood test riddle (number theory)

A microbiologist has been given a set of $100$ blood vials. Exact one of those $100$ vials is positive to a concrete disease X. The microbiologist desires to send only $7$ vials for analysis. He can ...
0
votes
1answer
33 views

Bitwise ops - The relationship between $a$, $b$, $a \wedge b$, $a \vee b$ and $a \oplus b$

In computer programming, the term bitwise operation is used to denote the use of boolean operators (and $\wedge$, or $\vee$, exclusive or $\oplus$) on corresponding bits of two numbers. Bits, in this ...
6
votes
1answer
156 views

Why is $2^{16}=65536$ the only power of $2$ less than $2^{31000}$ that doesn't contain the digits $1$, $2$, $4$ or $8$ in its decimal representation?

$65536$ is the only power of $2$ less than $2^{31000}$ that does not contain the digits $1$, $2$, $4$ or $8$ in its decimal representation. http://en.wikipedia.org/wiki/65536_%28number%29
0
votes
0answers
34 views

Is there an alternative encoding scheme to binary where similarity of pattern correlates with size of number?

If I compare binary for 7 111 and binary for 8 1000 there is no correlation between these two patterns that suggests that ...
-1
votes
1answer
49 views

Binary strings and recurrence relations [closed]

So the problem is: How many binary strings of length n contains 111? Give a recurrence relation Tn, where Tn is the number of binary strings of length n that contains 111. How could we possibly ...
2
votes
3answers
59 views

Determining if a relation is reflexive, symmetric, or transitive [closed]

Let $A = \{0,1,2,3\}$ Define a relation $T$ on $A$ as follows: $T = \{(0,1),(2,3)\}$ Is $T$ reflexive? symmetric? transitive?
0
votes
3answers
38 views

Finding the equivalence classes of a relation R

Let A = {0,1,2,3,4} and define a relation R on A as follows: R = {{0,0},{0,4},{1,1},{1,3},{2,2},{3,1},{3,3},{4,0},{4,4}}. Find the distinct equivalence classes of R. How do I solve this problem? ...
0
votes
1answer
35 views

Proving Equivalence Relations On A Set

Let X be the set of all nonempty subsets of {1,2,3}. Then X = {{1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}} Define a relation R on X as follows: for all S and T in X, SRT if, and only if, the least ...
1
vote
0answers
23 views

How to determine size and height balance of binary search tree?

I've been reading/ learning binary search trees and I've been stuck on the following question for a while now. I have the following tree, how do I determine the height and size balance of it? How do ...
0
votes
1answer
22 views

Algorithm for Converting Non-balanced Base-n to Balanced Base-n (for odd n)

Let $n \in 2 \mathbb{N} - 1$. I was wondering what sort of algorithms there are for converting (non-balanced) base-n to balanced base-n, where "balanced" is as is described in this article: ...
1
vote
2answers
80 views

How to check quickly $\frac{2}{3}=.101010… $ holds?

Every $x \in [0, 1]$ can be expressed in the form $\dfrac{a_1}{2}+\dfrac{a_2}{2^2}+\dots + \dfrac{a_m}{2^m}+\dots$ , where each $a_i$ equals either $0$ or $1$. For such $x$, we have the binary ...
1
vote
2answers
75 views

Recursively defining sets of strings discrete math

So here are the two problems: Recursively define the set of bit strings K that do not have 00 as its substring. How many bit strings of length 10 are included in the above set K? Can someone ...
1
vote
1answer
21 views

Essential Prime Implicants and Minterm Expressions

I have an exam for a university course shortly, and upon reviewing one of my assignments I have come to realize that I don't understand why I have lost marks/how to do a couple of questions. Hopefully ...
0
votes
3answers
27 views

Binary remainder not equal to the decimal remainder

I am having a weird result. I am dividing the binary number $10101010100000$ by $10011$. In binary division. I get $R= 0100$ which is 4. However, If I consider the decimal representation of the ...
0
votes
1answer
27 views

Binary Representation of the Collatz Conjecture

What is the benefit of looking at the binary representation of the collatz conjecture. I know that it makes the computation easier because there is really one operation involved which is multiplying ...
0
votes
1answer
21 views

why borrow two 1s in binary substruction?

In binary subtraction i have seen some tutorial and some sites that during 0-1 process borrow value from next 1s. Let's say one of tutorial is this ...
2
votes
1answer
37 views

What is the minimum longest repeated substring of a binary string of size n?

The longest repeated substring of 0111011 is 011 for example. My question is given the size of a binary string, what is the shortest this longest repeated substring can be. I have computed values for ...
0
votes
1answer
18 views

Evaluating the decimal equivalent of binary numbers in; sign and magnitude, one's complement and two's complement

For example, i have this binary number : 1011 1101 Now i wish to evaluate the decimal equilant using sign and magnitude, one's complement and two's complement. Now for sign and magnitude, i know the ...