How does machine learning relate to artificial intelligence?
Machine Learning is a subset of (the scientific field of) Artificial Intelligence.

What is ML?

Machine Learning is defined by Tom Mitchel:


  A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P if its performance at tasks in T, as measured by P, improves with experience E.


Hence: When you write an algorithm that gets better the more data you give it, then you can call it ML.

What is AI but not ML?


SLAM
Path finding: Bellman–Ford algorithm, A* search algorithm, Dijkstra's algorithm
Markov chains
cellular automata
Logic: Although a lot of people (e.g. Pedro Domingos) include logic approaches (e.g. with inverse deduction) in Machine Learning, I would rather say it is AI.


Fuzzy logic (see Fuzzy logic vs AI vs Machine learning vs Deep learning)
Knowledge representation / Formal systems



See also


Difference between machine learning and artificial intelligence