Translate the following inference to logic notation: If Elisabeth sleeps, then Karen is a writer. David is writing a letter if and only if Elisabeth is sleeping. If Karen were a writer, then David is writing a letter. If David writes a letter, then Elisabeth is sleeping. Therefore David is writing a letter if and only if Karen is a writer.
p -> q. r <-> p. q -> r. r -> p. Therefore r <-> q.