| 1 | 2 | 3 | 4 | 5 | 6 |
L = { x ∈ {0,1}* | [x]2 mod 6 = 0 }
Now Consider the languages A, B, C from the previous problem. Use cfgrep to solve the following puzzle: A secret message has been hidden via a file containing all length 16 bitstrings, and a code book. The message consists of three words. To discover the first word do the following:
HINTS:
S   →   ε   |   aSbgenerates the language { anbn   |   n ≥ 0 }.
S → 0 | 1 | 00S | 01S | 10S | 11S
L7 = { aibjck | i = j = k and i, j, k ≥ 0 }is not context free.
DFA_FIVENESS : Given a DFA A, decide if |L(A)| = 5.Show that DFA_FIVENESS is decidable by describing an appropriate Turing Machine.
L1 = { binary strings which represent prime numbers }You may use any of the deterministic models that suits you (i.e. you can assume several stacks, and allow a "stay" move, etc. )
CFG_FIVENESS : Given a CFG G, decide if |L(G)| = 5.Show that CFG_FIVENESS is decidable by describing an appropriate Turing Machine.
Given any bitstring x. Let n = |x| be the length of x and let m be the numerical value of x in binary. Decide if for some number j in the range [1, 2n], m = j j mod 2n.For full credit your algorithm should use heavy branching and result in significantly shorter computations than the "obvious" deterministic version. Explain why you are making use of non-determinism.
f (m) = s(m)[ 2 , |s(m)| ]HINTS: You can test your formula against the following matlab code for f on CUNIX. The matlab version of n(x) is bin2dec. Strings in matlab are defined by single quotes, e.g. x = '01'. Concatenation in matlab is achieved as follows: to concatenate x = '01' with y = '110' simply write [ x y ].
L1 = { x # y # z # w | x, y, z, w represent binary numbers with the property x y mod z = w }HINT: 61000 = 6512 + 256 + 128 + 64 + 32 + 8 = 65126256612866463268 = 629628627 626625623 = ((((((((62)2)2)2)2)2)2)2)2 · (((((((62)2)2)2)2)2)2)2 · ((((((62)2)2)2)2)2)2 · (((((62)2)2)2)2)2 · ((((62)2)2)2)2 · ((62)2)2
GIVEN: A boolean expression φ on boolean variables x1, ... , xn and a partial truth-value assignment to the first k variables x1, ... , xk.
DECIDE: Does there exist a truth-value assignment to the remaining variables xk+1, ... , xn which causes φ to be satisfied?Then try to discover the correct assignment by asking a series of questions each answerable by the above decision problem.