Question: I am studying Informatics and I am interested in doing a Masters in Robotics and I was checking out some unis and their courses and I saw that Robotics contains analysis and a lot of math.

Why is that?

Answer: 
Your mechanism will depend on the type of dispenser you want. Like if its gravity feed or not. I will assume it is, so I make this sketch to give you some idea:

![electronics candy dispenser sketch](https://i.stack.imgur.com/5EEuB.gif)

The hole size will depend on how many candy you want to dispense at each stroke. (Of course its related to the candy size). The electro-mechanical actuator can be a crankshaft one, a solenoid, a linear motor, and goes on.

You can use a vibrator attached to the cup if the candy tends to get stuck.
There are two good search terms that come to mind. The first one is a "candy machine mechansim", or "dispenser mechanism" (e.g. <http://www.woodworkingformeremortals.com/2012/10/make-candy-dispenser.html>). There are several models of off-the-shelf pet food dispensers and cereal dispensers that use this method.

[![cereal dispenser](https://i.stack.imgur.com/Ab4YPm.jpg)](https://i.stack.imgur.com/Ab4YP.jpg)

The second term would be a [screw conveyor](http://en.wikipedia.org/wiki/Screw_conveyor) (a.k.a. "auger dispenser"/"food auger"/"grain auger"), which describes a more continuous-flow version of what you are describing.

![screw conveyor](https://upload.wikimedia.org/wikipedia/commons/2/22/Archimedes-screw_one-screw-threads_with-ball_3D-view_animated_small.gif)

This type of dispenser controls the volume that is delivered by rotating the auger by a fixed amount, not by dumping a fixed-size container.

Beyond those, there are some homemade concepts that use some variation on the idea, like this one:
[![sliding cat food dispenser](https://i.stack.imgur.com/UsIeTm.jpg)](http://omahamakergroup.org/2011/06/24/evening-project-automatic-cat-food-dispenser/)