Skip to content

Instantly share code, notes, and snippets.

View 0xdeafbeef's full-sized avatar
🦀

Vladimir 0xdeafbeef

🦀
  • Belgrade
  • 10:00 (UTC +01:00)
View GitHub Profile
@0xdeafbeef
0xdeafbeef / gist:5a35fc5f50b507b39089d3d39a79e969
Created January 22, 2018 14:26
Finds minimum code distance in BCH codes
public class MinDistanceSolver {
public static void main(String[] args) {
double currentRowState, p = 2.555 * Math.pow(10, -3), q = 1 - p, pTransformation = Math.pow(10, -11); // Данные
int dMinimum = 1, n = 31, k = 1; //Данные
double pInhibition; // Данные
System.out.println("-------------------------------------------------------"); //декоратор
do { //расчет Д минимум
System.out.print(dMinimum + " ");
currentRowState = combinator(n, dMinimum) * Math.pow(p, dMinimum) * Math.pow(q, n - dMinimum) * (((dMinimum + 1) * q) / ((dMinimum + 1) - ((n + 1) * p)));
System.out.println(currentRowState);