How to implement bit error based on percentage in C? : <p>I'm stuck at trying to simulate an Binary Symmetric Channel in C.</p>

<p>It should work like this: the user enters a number (for example 0.01 = 1%) which represents error rate. So, for instance, if i read 1001 from file every bit has a chance to change its value to 0/1 respectively depending on the entered percent.</p>

<p>Reading from file and writing into another is already working, but I just don't know how to make these percentage-based errors happen.</p>

<p>Any help is much appreciated, thanks in advance.</p>
