Cloud computing, and particularly mobile cloud computing, contains a great deal of uncertainty. User requirements are changeable, and environmental factors, such as network delay and bandwidth availability, as well as changing prices, make efficient allocation of resources challenging. Stochastic optimization is a technique designed to solve optimization problems, such as for resource allocation, in a way that accounts for the uncertainty of future parameters. It is a flexible and powerful technique, and in this thesis I demonstrate three key areas where it can be used with great efficacy. The two key resources in mobile cloud computing are computation and bandwidth. The problem of migrating computation to the cloud through virtual machines (VMs) has been addressed in prior work, as has the problem of routing bandwidth through a network effectively. However, to provision resources in the cloud, these two must be allocated in concert, as they are interdependent. Without sufficient bandwidth, efficient computation will be wasted, and a clear network path is worthless if the destination lacks computing power. Many cloud services (e.g., Amazon) offer a reservation option for VMs that can be used to reduce costs if uncertainty is properly accounted for. Likewise, the recent development of Software Defined Networking (SDN) allows the creation of flexible, multi-tenant networks allowing bandwidth reservation. In this thesis I apply stochastic optimization to the problem of jointly provisioning VMs and bandwidth despite uncertain user demand and price information and show results to demonstrate the importance of joint allocation. Much of research in mobile cloud computing focuses on the problem of energy efficiency in mobile devices. In addition to offloading to the cloud, the rise of the Bring-Your-Own-Device (BYOD) paradigm has inspired research into offloading to local equipment (such as a desktop PC). Users who require low latency or a larger screen may prefer not to offload to the cloud, so I propose a model where users can travel to a location (such as a library) and offload their computation to local equipment. Due to a variety of factors, such as user battery levels, number of users, and application requirements, deterministic methods are inadequate. I apply stochastic optimization to the problem to maximize the number of users able to access equipment. The third major issue in cloud computing is the problem of computer security. Mobile users offloading to the cloud, or to local equipment, require reassurance that their data and communications will be secure. Thus, Security-as-a-Service (SECaaS) has arisen to provide security in the cloud without taxing the user's processing resources. However, no security is perfect, and a successful cyber attack is inevitable. Cyber insurance provides compensation in the event of a successful attack. In this thesis I consider a joint provisioning of cyber insurance and SECaaS using stochastic optimization to reserve security services and purchase insurance policies, allowing for uncertainty in attack probabilities, attack success and pricing. I find that cyber insurance can be used to encourage security investment. This thesis contributes to the field of mobile cloud computing in two major ways. The first is the application of stochastic optimization to three vital and related areas in computation offloading, bandwidth provisioning, and cyber security and insurance. In each case I provide numerical results based on parameters derived from real usage data, such as cluster usage traces, mobile user movements, and honeypot attack data. These numerical results show the effectiveness of stochastic optimization as it accounts for uncertainty in a way that is necessary for a realistic model of cloud computing. Secondly, I provide performance optimizations and sensitivity analyses for each problem area. As some decision variables are integer values, I employ two methods (a scenario tree reduction method and a partial Lagrange multiplier algorithm) to significantly improve the solution runtime and show their effectiveness through analytical and numerical results. I formulate two linear programs to perform the sensitivity analysis, giving precise values for the sensitivity range of parameter values. In summary, in this thesis I focus on the application of stochastic optimization to key areas in mobile cloud computing. Existing research either fails to account for uncertainty, or fails to consider interdependent resources in a suitably rich joint approach. To the best of my knowledge, this is the first work to consider joint VM and bandwidth provisioning under uncertainty, to propose the local equipment offloading model, and to apply multi-stage recourse and real test data and sensitivity analysis to joint SECaaS and cyber insurance provisioning. Thus each contribution introduces novel system models, with solution improvements, analysis, and test data that has not been considered until now. Doctor of Philosophy (SCE)