Partial Answer
Let x be the weight of a lighter coin, then the total weight of all coins is 50x + 51(x + 1) = 101x + 51
Suppose you pick a light coin, place it on 1 side , place all remaining coins on the other side so now on one side you have 49x + 51(x + 1) and on the other side you have x. The difference is
49x + 51(x + 1) - x = 48x + 51(x + 1) = 99x + 51
Suppose you pick a heavier coin, place it on 1 side, place all remaining coins on the other side so now on one side you have 50x + 50(x + 1) and on the other side you have (x + 1). The difference is
50x + 50(x + 1) - (x + 1) = 50x + 49(x + 1) = 99x + 49So... When the machine gives you the difference. subtract 49 then divide by 99. If you get a whole number then you picked the heavier coin, otherwise you picked the lighter coin.
Note*This method works pretty well only if the coins have whole number weights. Further consideration of what may happen if the coins don't have whole number weights is giving me a headache so i stop here.
:)