# OK to post # HW4, Robert Dougherty-Bliss, 2024-02-01 # 3. read "C4.txt": K := 1000: # this takes a while to run. get_max_sizes := proc(K, attempts): max_sizes := table(): for d in [3, 5, 7] do for n from 5 to 16 do max_size := -1: best_code := NULL: for attempt from 1 to attempts do code := RC(2, n, d, K): if nops(code) > max_size then max_size := nops(code): best_code := code: fi: od: max_sizes[(d, n)] := max_size: od: od: op(max_sizes): end: # 4. # A perfect code matches the sphere packing bound. So, any perfect (2, n, 3) # code must have # 2^n / (1 + n). # In this case, with n = 2^r - 1, we have # 2^(2^r - r - 1) # codewords.