Adverse effects of learning algorithms: case studies on data privacy and algorithmic pricing