Tuesday, January 19, 2010

Qualifier Practice Exam: Foundations

Question 3 (4 Points): Suppose you have an alphabet with k characters. How many
strings of length n from this alphabet are palindromes?

Return later.

Question 4 (5 Points): should get a math-writing piece of software. Ugh. Will return later.

Question 5 (3 Points): Write a truth table for the following logical expression.
A V B' -> (A V B)'

A B B' AVB' AVB (AVB)' A V B' -> (A V B)'
T T F T T F F
T F T T T F F
F T F F T F T
F F T T F T T

Question 6 (2 Points): Draw a Venn Diagram (shaded circle diagram) for the following
set.
{x|((x in A) or (x in B)) and x not in A ^ B}

I don't have a drawing utility right now, but that would be two circles that overlap with the circles shaded but not the section of overlap not shaded.

1 comment:

  1. Question 3:

    So basically, you can only use the multiplication rule for the first half of the string, because the second half is predetermined. if the string is of odd length, then the middle character can be whatever, so you can use the multiple rule on that k again.

    If n is odd:
    k^(n/2) * k

    **Note that you discard any remainder for odd divisions.

    If n is even:
    k^(n/2)

    If they want just one formula then:
    k^(n/2) *(k^(n mod 2))

    This, of course, only works for n > 1
    n = 1 is just k, if a single character is a palindrome.

    d:- D
    PS lemme know if im right!!

    ReplyDelete