Combinatorial quorum sensing allows bacteria to resolve their social and physical environment