Facebook Inc. is applying to patent software that it could use to create profiles of users’ households by making educated guesses about how many people live in the household, what their relationships to each other are, what interests they share and what electronic devices they use.