Base for homework on beer and lemon problems