How to throw definite quantity of an item in Minecraft Pocket Edition?

You can either split it up in a chest beforehand, or use the new "Classic" interface (I believe it is in the video area of the settings), to split it up in your inventory (hold and drag to split, tap on one stack then another to merge, you'll eventually be able to separate 20 from a stack). Then, you can either put it in your hotbar and hold on it, or you can tap on it in your inventory and then tap out of the inventory to drop it.