Skip to main content
2 of 2
edited title
Lukas Lang
  • 34.4k
  • 1
  • 56
  • 99

What does the operation Map[({...}=#;{...})&, ] do?

With reference to the answer by @Bill to the question posted here, I am trying to understand the following three lines

  u = RandomReal[{0, 1}, {20, 5}]
  v = Map[({x, y, z, a, b} = #; {x, y, z, a, b, 1 - a - b}) &, u]
  w = Take[Select[v, ({x, y, z, a, b, c} = #;  x^2 + y^2 + z^2 <= 1 && x + y - 1 <= z <= -x + y + 1 && z >= -x - y - 1) &], 3]

Clearly u generates $20 \times 5$ array of random (real) numbers between 0 and 1. But I do not understand how Map[({x, y, z, a, b} = #; {x, y, z, a, b, 1 - a - b}) &, u] is working. Both v and w involve something like ({}=#;{})&. What does this operation do?

seeker
  • 577
  • 2
  • 7