The Lagrangians of physics arise out of a mathematical game between a ``smart'' measurer and nature (personified by a demon). Each contestant wants to maximize his level of Fisher information I. The game is zero sum, by conservation of information in the closed system. The payoff of the game introduces a variational principle-extreme physical information (EPI)-which fixes both the Lagrangian and the physical constant of each scenario. The EPI approach provides an understanding of the relationship between measurement and physical law. EPI also defines a prescription for constructing Lagrangians. The prior knowledge required for this purpose is a rule of symmetry or conservation that implies a unitary transformation for which I remains invariant. As an example, when applied to the smart measurement of the space-time coordinate of a particle, the symmetry used is that between position-time space and momentum-energy space. Then the unitary transformation is the Fourier one, and EPI derives the following: the equivalence of energy, momentum, and mass; the constancy of Planck's parameter h; and the Lagrangian that implies both the Klein-Gordon equation and the Dirac equation of quantum mechanics.