In this thesis, we apply computer science techniques to try to solve a selection of problems that arise in economics and electronic commerce. Roughly speaking, our contributions can be divided into two parts. In the first part, we use a computational approach to find solutions to problems from economic theory. In the second part, we design and implement agents for making complex decisions in various electronic commerce domains. The thesis is organized into chapters most of which are based on previously published joint work with other authors. The title of each chapter has a footnote indicating the authors and, if applicable, the original publication. The first part of the thesis focuses on applying computer science techniques to problems in economics; specifically, in mechanism design (Chapter 2) and game theory (Chapter 3). Mechanism design and game theory are concerned with problems where multiple self-interested participants take actions to optimize utility based on the incentives provided to them. The interplay between incentives and participants' behavior is at the core of the disciplines.