Skip to content

Commit

Permalink
Correct indent
Browse files Browse the repository at this point in the history
Otherwise the content won't be shown under the item number 2.
  • Loading branch information
eliasdiem committed Oct 21, 2014
1 parent 04ec2b1 commit e30e4e5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ch02/2.2/2.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,23 @@ the following languages. In each case show that your grammar is correct.
2. No. Consider the string "10101", which is divisible by 3, but cannot be
derived from the grammar.

Readers seeking a more formal proof can read about it below:
Readers seeking a more formal proof can read about it below:

**Proof**:
**Proof**:

Every number divisible by 3 can be written in the form `3k`. We will consider `k > 0` (though it would be valid to consider `k` to be an arbitrary integer).
Every number divisible by 3 can be written in the form `3k`. We will consider `k > 0` (though it would be valid to consider `k` to be an arbitrary integer).

Note that every part of num(11, 1001 and 0) is divisible by 3, if the grammar could generate all the numbers divisible by 3, we can get a production for binary k from num's production:
Note that every part of num(11, 1001 and 0) is divisible by 3, if the grammar could generate all the numbers divisible by 3, we can get a production for binary k from num's production:

```
3k = num -> 11 | 1001 | num 0 | num num
k = num/3 -> 01 | 0011 | k 0 | k k
k -> 01 | 0011 | k 0 | k k
```
```
3k = num -> 11 | 1001 | num 0 | num num
k = num/3 -> 01 | 0011 | k 0 | k k
k -> 01 | 0011 | k 0 | k k
```
It is obvious that any value of `k` that has more than 2 consecutive bits set to 1 can never be produced. This can be confirmed by the example given in the beginning:
It is obvious that any value of `k` that has more than 2 consecutive bits set to 1 can never be produced. This can be confirmed by the example given in the beginning:
10101 is 3*7, hence, k = 7 = 111 in binary. Because 111 has more than 2 consecutive 1's in binary, the grammar will never produce 21
10101 is 3*7, hence, k = 7 = 111 in binary. Because 111 has more than 2 consecutive 1's in binary, the grammar will never produce 21
### 2.2.6
Expand Down

0 comments on commit e30e4e5

Please sign in to comment.