Computer Science Concepts - Test 2


  1. Four statements about strings. Three of them are incorrect. Which one is correct?

    1. A string is a set of symbols.

    2. A string is a sequence of symbols.

    3. A string is a set of alphabets.

    4. A string is a sequence of alphabets.

    check/hide answer

  2. Four statements about languages. Three of them are incorrect. Which one is correct?

    1. A language is a set of symbols.

    2. A language is a sequence of symbols.

    3. A language is a set of strings.

    4. A language is a sequence of strings.

    check/hide answer

  3. If x is a string uwe, y is a string ac, and z is a string uk, what is x.y.z?

    1. x.y.z = xyz = uweacuk

    2. x.y.z = uwe.ac.uk

    3. x.y.z = ((z.y).x) = ukacuwe

    4. x.y.z = 3*2*2=12

    check/hide answer

  4. Which of the following languages are exactly same?

    L1 = {^, a, b}

    L2 = {^, b, a}

    L3 = {a, b}

    Note that, ^ (i.e. lambda) means an empty string.

    1. L1 and L2

    2. L1 and L3

    3. L2 and L3

    4. No, they are all different languages

    check/hide answer

  5. We want to define a language which contains all binary strings of length less than or equal to 3. Which of the following is the correct way to define it?

    1. { xxx | x is in {0,1} }

    2. { xxx | x is in {^,0,1} }

    3. { xyz | x, y, and z are in {0,1} }

    4. { xyz | x, y, and z are in {^,0,1} }

    check/hide answer


Rong Yang,