Simulation optimization is a research area that aims to efficiently combine simulation with optimization. This talk focuses two actively studied areas in simulation optimization: ranking and selection (R&S) and sensitivity analysis. The speaker shows an unexpected phenomenon that many popular sampling allocation procedures in R&S decrease the probability of correct selection (PCS), which is caused by the imperfect theoretical foundation of these methods. To address the problem, a dynamic sampling and selection framework is proposed. Under this framework, R&S can be formulated as a stochastic control problem and efficiently solved in an approximate dynamic programming (ADP) paradigm. Two ADP approaches are provided. One using a single feature of the value function sequentially achieves an asymptotically optimal sampling ratio that cannot be achieved by the many existing sequential sampling procedures. Another ADP approach using two features avoids the non-monotonicity of the PCS. In sensitivity analysis, the speaker introduces a new unbiased stochastic derivative estimator called generalized likelihood ratio (GLR) method that can handle a large scope of discontinuities. Several applications are put together under the umbrella of distribution sensitivities and solved uniformly by GLR.