Essays on optimal allocation of resources by governments