New answers tagged

1

You can deliberately define an irrational number to have this non-repeating quality, if required. For example, for an irrational number that avoids 3-blocks of repeating digits, take the binary definition of $\pi$ and generate a new number such that each digit $x$ in $\pi$ is replaced by $11x00$. (This also avoids 4-blocks). To avoid any repetitions of ...


1

Hint: You have 11 places to fill, and you can put five ones in the eleven places, the rest will be zeroes. Once you choose (hint, hint) the positions of the ones, the zeroes are fixed. Each choice of ones will give exactly one unique ordering.


1

Don't get confused by the change of base. The first expression is obviously less than the second because you are subtracting the same number from .11 as you are from 1, and .11 is a fraction between 0 and 1 so it must be less than 1. $$ $$ To add/subtract binary, you can use operations essentially identical to base 10 addition/subtraction. For example, ...


0

What is the probability of tossing in any order: $m$ of one result and $m+k-1$ of the other, and then one more of the second result? That is: $\mathsf P(N\leq 2m+k)$


0

In unsigned binary, all numbers are positive and you can't subtract a larger one from a smaller one. If we translate your problem to base $10$ we get $49-171$ which does not have an answer. For unsigned binary you just do subtraction like you learned in school except in base $2$, borrowing when necessary. So if we want to do your problem in reverse, ...


1

Suppose you have a 11-bit binary number $a_1a_2\dotsm a_{11}$, where each of the $a_i$ is a binary digit (0 or 1). In the normal interpretation of binary numbers, the value of this would be $2^{10}\cdot a_1 + 2^9\cdot a_2 + \dotsb + 2^0\cdot a_{11}$. However, when you're using the offset system, the value is taken to be $2^{10}\cdot a_1 + 2^9\cdot a_2 + ...


1

I will use a decimal analogy here. Let's consider the case of rounding $x=123.45$ to the nearest integer $X$. The round-to-nearest approach requires that the rounded result $X$ is as close to the non-rounded number $x$ as possible. This means $|X-x|\leq\frac{1}{2}=0.5$. That requirement translates to: Round downwards if the leftmost digit of the ...


3

Because dropping $0.11011$ is closer to $0.11$ (difference $0.00011$) than to $1.00$ (difference $0.00101$).


1

If you round any binary number to three digits after radix point, then each possible number, e.g. $0.000, 0.001, 0.010, 0.011$, etc), differ from the next one by $0.001$. If the truncated part is less than half of that, i.e. $0.0001$, then the number is rounded down: $$0.10001 \approx 0.100$$ If the truncated part is more than half of $0.001$, then the ...


1

Add $1$ in the last place. In your case, add $\frac{1}{8}$ to get the number $1$, which we should write as $(1.00)_2$ to keep the number of significant figures at $3$. EDIT: Adding anything smaller than $1$ in the last place would automatically increase the number of significant figures in the result. Specifially, if we start with $(1.11)_2 \times 2^{-1} = ...


1

\begin{align} 0.1100 &= 2^{-1} + 2^{-2} \\ 0.1101 &= 2^{-1} + 2^{-2} + 2^{-4} \\ 0.1110 &= 2^{-1} + 2^{-2} + 2^{-3} = 2^{-1} + 2^{-2} + 2\cdot2^{-4} \end{align} Therefore, the difference between $0.1100$ and $0.1101$ as well as between $0.1101$ and $0.1110$ is $2^{-4}$, and hence $0.1101$ does indeed lie halfway between the two other numbers.


2

Calculate the average of $0.110$ and $0.111$, by adding them and dividing the result by $2$ (keep in mind that it is binary), and see that you get $0.1101$.


-1

I have my own answer. Just today I was reading What Just Happened: A Chronicle from the Information Frontier by James Gleick. When it talks about the Kolmogorov–Chaitin complexity it mentions: Some mathematical facts are true for no reason. They are accidental, lacking a cause or deeper meaning. Whether there's more to 82000 than "the smallest number ...


0

The strings of interest as those that are either increasing or decreasing. Writing $x \Rightarrow y$ as a shorthand for $\lnot x \lor y$, you can characterise them in the follow compact way: $$ \begin{align*} &[(b_1 \Rightarrow b_2) \land (b_2 \Rightarrow b_3) \land (b_3 \Rightarrow b_4) \land (b_4 \Rightarrow b_5)]\\ \lor \quad&[(b_5 \Rightarrow ...


0

The key thing to understand here is that, what you have quoted is not actually a propositional formula. Things like "$\bigwedge\limits_{i=0}^k$" are not themselves part of the syntax of propositional formulas. Instead what you have is a shorthand recipe for how to construct a formula. The actual formula that the notation is asking you to imagine is quite ...


3

I am not quite sure about this notation but suppose that $R$ is the relation such that if $(x,y)\in R$ then $x\leq ay: a,x,y \in \mathbb{R}$. Let's think about $y\geq \dfrac{x}{a}$. Geometrically, this is interpreted as the region including and above the line $y=x/a$. So suppose $(x,y) \in R$ and $(y,z)\in R$. We want to show that $(x,z)\in R$, hence the ...


1

In general it depends on the string. $P_1$ does not depend on your chosen string. It can be expressed as $1-\left(1-2^{-N}\right)^M$. $2^{-N}$ is the probability of matching each element of $B_1$, so $\left(1-2^{N}\right)^M$ is the probability of not matching any of the $M$ elements of the array. Consider for simplicity the case where $M=N=2$. In this ...


3

While Roberts Frost's answer is perfectly correct there is however one small catch! When engaged in practical computations which seek to obtain an approximation $A$ to the solution $T$ of a complicated equation, then there is a profound difference between the statement $T \approx 1$ and the statement $T \approx 1.0$. In the first case, we implicitly state ...


1

Short C code: double x = 0.1; long long n = *(long long*)&x; printf("%llX",n); Gives 3FB999999999999A, which is equivalent to: 0011 1111 1011 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1010 For the record, due to the strict aliasing rule, I cannot recommend this programming method.


2

Yes it's exactly the same system. The only restriction on decimal relative to binary is no digits 2-9. As per your proof, removing a trailing zero is always equivalent to subtracting zero and therefore has no effect.


1

There is a much quicker way of applying the "round to the nearest" rule than by carrying out subtractions. Suppose rounding down gives $a$ and rounding up gives $b$. The "round to the nearest" rule says round to whichever of $a,b$ is nearer. That is unambiguous unless the number is $\frac{a+b}{2}$ which is equidistant. We deal with that case by a ...


2

First of all your differences are wrong: 0.101 - 0.10 = 0.001 etc. Second rounding to nearest must be completed with a tie breaking rule if there are two representable numbers with the same difference to the number to be rounded; in your case both candidate numbers are $\pm 1/8$ from the original number: 0.101 - 0.10 = 0.001 = 1/8 0.101 - 0.11 = -0.001 = ...


1

There is no such fraction, because if $$ A = a_na_{n-1}\dots a_1a_0.a_{-1}a_{-2}\dots a_{-m} $$ is your finite binary representation then the number is $$ A = \sum_{k=-m}^n a_k 2^k $$ and $\frac12=0.5$. When multiplying numbers you can get the lowest digit by taking the lowest digit of the product of the lowest digits of the factors. E.g. the lowest digit ...


1

No (unless you count integers). A nonintegral binary number with terminating representation has the form $$a_m \cdots a_0 . a_{-1} \cdots a_{-n}$$ where $a_m, \cdots, a_{-n+1} \in \{0, 1\}$ and $a_{-n} = 1$, and has value $$2^m a_m + \cdots + 2^{-n + 1} a_{-n + 1} + 2^{-n} .$$ Now, $2^{-n} = \frac{5^n}{10^n}$, and in particular the numerator of this quantity ...


3

The numbers you want are of the form $$\sum_{n=1}^k\frac{\alpha_n} {2^n}, $$ where $\alpha_n\in \{0,1\} $. We can rewrite as $$ \frac {\sum_{n=1}^k{\alpha_n}\,2^{k-n}} {2^n} =\frac {\sum_{n=1}^k{\alpha_n}\,2^{k-n}5^n} {10^n} . $$ As the numerator is a multiple of five, the decimal expression will always end in five.


0

Let $0\leq x,y\leq2^{N}-1$, s.t. $x<y$. To show that I get the "correct result", means to show that: $(x-y)\mod2^N = 2^N-(y-x)$ (I guess that what I was having difficulty defining...). Now if I apply $\mod 2^N$ on RHS: $(2^N-(y-x))\mod 2^N$ $(2^N+(x-y))\mod 2^N=$ $(2^N\mod 2^N+(x-y)\mod 2^N)\mod 2^N= $ $(0 + (x-y)\mod 2^N)\mod 2^N=$ $(x-y)\mod 2^N$


1

Inadvertently, you have asked more than one question. I will only answer the question "if you take the n first natural numbers (without zero), and if you write their representation in binary and if you make the sum of their digits in the binary represention, how much 1, 2, 3, et ceatera, will you find in this list? " which is what you meant to ask anyway. ...


1

You know all of the $x_i$s are either $0$ or $1$. You also, hopefully know that the infinite sum $$ (2^{-1} + 2^{-2} + 2^{-3} + \cdots) = 1 $$ so in your final equation we have $$ x_1\cdot 2^0 + \underbrace{x_2\cdot 2^{-1}+x_3\cdot 2^{-2}}_{\text{ at most }1} = 1.25 $$ Since the right-hand side is larger than $1$, the $x_1\cdot 2^0$ term must be nonzero -- ...


3

Straightforward binary addition only works for twos-complement representation. Sign-magnitude represenation is more complicated, which is why nobody uses it.


1

After seeing some comments I believe this would be my answer P(X= Beware) = 2/5 P(X= the) = 1/5 P(X = jabberwork) = 1/5 P(X= my) = 0 P(X= son) = 0 Feel free to state whether this is right or wrong


0

No, it's not correct. First, here $X$ is a number (random), not a set. When you're asked "give the probability distribution of $X$", your answer needs to be $P(X=a) = ?$, $P(X=b) = ?$, etc. So, what's the probability that $X=0$? that $X=1$ and $X=2$? Is there another value that $X$ can take ?


0

$1+1+1+1=100$, so it carries like this: 10 1101000 0101100 1011000 0001000 ------- 0100 Here I’ve shown only what you have after dealing with the four leftmost columns.


0

(To clear it up for anyone who might not know why $p$ and $q$ are bounded by their 'bit size':) If $p$ and $q$ are $512$-bit primes, first we would need to see what the largest value of $p$ and $q$ could possibly be. So consider some simple cases: If $p$ and $q$ are $3$-bit primes, then the maximum possible binary number they could be is ...


2

Let's approximately model the digits of a number in positional notation with coprime bases as independent random variables, and likewise for the number's residues with respect to powers of different primes, with mutual conditional independence. (I think you could make this more rigorous by uniformly randomly selecting a number between $1$ and $N$ and taking ...


1

"On the maximum number of distinct factors of a binary string" (also here), by Jeffrey Shallit, proves that the answer (the attained maximum number of distinct factors of a length-$n$ binary string) is $$\binom{n-k+1}{2}+2^{k+1}-1,$$ where $k$ is the unique integer such that $$2^k + k - 1\ \le\ n\ \lt\ 2^{k+1}+(k+1)-1.$$ (This counts the empty string as a ...


1

When you count up to $2^{32}$, you start counting $1$, $2$, ... then the $2^{32}$th number is $2^{32}$. Since the computer has to store the number $0$ in an unsigned int, it is actually starting to count with $0$, then $1$ and so on. That means that the $n$th number for the computer is, in fact, $n-1$. Hence, the biggest number it can store, the $2^{32}$th ...


0

I've decided to write down the number in the following form: $$ 2\times(2\times(2\times(1\times2^1+0\times2^0)+1\times2^0)+1\times2^0)+1\times2^0 $$ And from this form it's clear that there are only 4 steps needed, so: 1) 23 = 22 + 1 // the first bit is 1 2) 22/2 = 10 + 1 // next bit is 1 3) 10/2 = 4 + 1 // next bit is 1 4) 4/2 = 2 + 0 // here, `2 + 0` ...


1

Let's start with some powers of $2$: $2^0 = 1$ $2^1 = 2$ $2^2 = 4$ $2^3 = 8$ $2^4 = 16$ $2^5 = 32$ We need to write out $23$, so this is enough powers of $2$. Start with the highest power of $2$ that is equal to or less than the number. This is $16$. So write a $1$ down and subtract it out: $23-16 = 7$. The next highest power, $8$, is greater than ...



Top 50 recent answers are included