MCPcopy Create free account
hub / github.com/Raibows/MLinRust / shuffle

Method shuffle

src/utils.rs:146–152  ·  view source on GitHub ↗

provable evenly shuffle each element is swapped with **equal probability** to any positions ## proof: for the last element, there is no probability for other elements swap with it before, each position is 1/n; for the second last element, the probability for position [0, n-1] is 1/(n-1), and the probability for finally swapping at the last position is depending on the last element, i.e. 1/n; th

(&mut self, arr: &mut Vec<T>)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

choiceMethod · 0.45
test_randFunction · 0.45

Calls 3

lenMethod · 0.80
gen_f32Method · 0.80
gen_rangeMethod · 0.80

Tested by 1

test_randFunction · 0.36