Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.60 KB | None | 0 0
  1. function probs = calculate_asymptotic_erasure_prob_to_arr(iterations, erasure_prob, bit_degree, check_degree)
  2.     if iterations == 0
  3.         probs = erasure_prob;
  4.     else
  5.         probs = calc_prob( ...
  6.             bit_degree, ...
  7.             check_degree, ...
  8.             erasure_prob, ...
  9.             calculate_asymptotic_erasure_prob_to_arr(iterations-1, bit_degree, check_degree, erasure_prob));
  10.     end
  11. end
  12.  
  13. function prob = calc_prob(bit_degree, check_degree, erasure_prob, bit_prob)
  14.     chd = check_degree-1;
  15.     bd = bit_degree - 1;
  16.     prob = erasure_prob*(1 - (1 - bit_prob)^chd)^bd;
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement