Translate the following inference to logic notation: If Thomas were rich, then Barbara is cooking. If Barbara cooks, then Jennifer is writing a letter. If Barbara cooks, then Thomas is rich. If Jennifer writes a letter, then Thomas is rich. Therefore Thomas is rich if and only if Barbara is cooking.
p -> q. q -> r. q -> p. r -> p. Therefore p <-> q.