# Finding positions of minimum values in list

I would like to find the positions of multiple occurrences of a minimum value in a list. For instance, for the list {1, 2, 1, 3}, I want to obtain the two positions for the occurrences of the number 1.

MinimalBy[{1, 2, 1, 3}, id (x)] gives me these occurrences, but not the positions.

• MinimalBy[Range@Length@list, list[[#]] &]? – Michael E2 May 2 '19 at 3:05
• Or modifying this answer: minpos[a_] := SparseArray[UnitStep[# - a]]["AdjacencyLists"] &@Min@a and then minpos[list]. – Michael E2 May 2 '19 at 3:11
• Possible duplicate: mathematica.stackexchange.com/questions/40231/… – Michael E2 May 2 '19 at 3:13

lst = {1, 2, 1, 3};
RandomPrivatePositionsOf[lst, Min @ lst]

 Flatten@Position[lst, Min @ lst]