The Law of Mass Action for Ideal Systems