Probabilistic fibre-to-target assignment algorithm for multi-object spectroscopic surveys