The production fractions of (B) over bar (0)(s) and Lambda(0)(b) hadrons, normalized to the sum of B- and (B) over bar (0) fractions, arc measured in 13 TeV pp collisions using data collected by the LHCb experiment, corresponding to an integrated luminosity of 1.67 fb(-1). These ratios, averaged over the b hadron transverse momenta from 4 to 25 GeV and pseudorapidity from 2 to 5, are 0.122 +/- 0.006 for (B) over bar (0)(s) and 0.259 +/- 0.018 for Lambda(0)(b) where the uncertainties arise from both statistical and systematic sources. The Lambda(0)(b) ratio depends strongly on transverse momentum, while the (B) over bar (0)(s) ratio shows a mild dependence. Neither ratio shows variations with pseudorapidity. The measurements are made using semileptonic decays to minimize theoretical uncertainties. In addition, the ratio of D+ to D-0 mesons produced in the sum of (B) over bar (0) and B- semileptonic decays is determined as 0.359 +/- 0.006 +/- 0.009, where the uncertainties are statistical and systematic.