Measurements of the muon charge asymmetry in inclusive pp to WX production at sqrt(s)=7 TeV are presented. The data sample corresponds to an integrated luminosity of 4.7 inverse femtobarns recorded with the CMS detector at the LHC. With a sample of more than twenty million W to mu nu events, the statistical precision is greatly improved in comparison to previous measurements. These new results provide additional constraints on the parton distribution functions of the proton in the range of the Bjorken scaling variable x from 10E-3 to 10E-1. These measurements and the recent CMS measurement of associated W + charm production are used together with the cross sections for inclusive deep inelastic ep scattering at HERA in a next-to-leading-order QCD analysis. The determination of the valence quark distributions is improved, and the strange-quark distribution is probed directly through the leading-order process g + s to W + c in proton-proton collisions at the LHC.