To generate all possible permutations for a collection of distinct numbers, you can use a recursion algorithm called backtracking. Here's the Python code:

```
def permute(nums):
    def backtrack(first):
        if first == len(nums):
            output.append(nums[:])
        for i in range(first, len(nums)):
            nums[first], nums[i] = nums[i], nums[first]
            backtrack(first + 1)
            nums[first], nums[i] = nums[i], nums[first]
        
    output = []
    backtrack(0)
    return output
```

You can call this function by passing in a list of distinct numbers:

```
print(permute([1,2,3]))
```

This will output all possible permutations:

```
[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 2, 1], [3, 1, 2]]
``` 

Note that this algorithm generates permutations recursively by swapping elements in the input list, thus it has O(n!) time complexity.
Data una raccolta di numeri distinti, restituire tutte le possibili permutazioni.