anchor.diff:          !    entry /U_j / < 1. (If one of these exists, the other must, as well.)
           ! 2. Allocate the unused space in entry j to outcome i, by setting /K_j /
           !    = /i/.
  -        ! 3. Remove the allocated space from entry i by changing /U_i / = /U_i /
  -        !    - (1 - /U_j /) = /U_i / + /U_j / - 1.
  +        ! 3. Remove the space from entry i that entry j got from entry i by changing 
  +        ! /U_i / = /U_i / - (1 - /U_j /) = /U_i / + /U_j / - 1.
           ! 4. Entry j is now exactly full.
           ! 5. Assign entry i to the appropriate category based on the new value of
           !    U_i .  
  
positive.code:         ! Out:
          !    ret: the index of the element chosen.
  
          ! [review] - JSS: I think the switch (multiple times) between k and N objects is confusing.
  
          ! The 'alias method' allows one to select from a discrete probability distribution of k objects (with object j having probability p_j) in O(1) time. 
          ! There's an O(k) storage and O(k) setup cost - a list of k reals (P_j) and k integers (Y_j)  which requires O(k) setup.
  
          ! Pick a random real number x, 0<=x<k.
          ! Let K=floor(x) and V=x-K. (so K is an integer and V the remainder).
  
negative.code:     end function select_weighted_value_prec
  
      ! [review] - JSS: is the alias method useful compared to simple binary search of the probabilities for one-off selections?
      ! [review] - VAN: How would you do the binary search to select an integer from a discrete probability distribution?
      function select_weighted_value(rng, N, weights, totweight) result(ret)
  
          ! Select an element, i=1..N with probability weights(i)/totweight.
  