//--------------------------------------------------------------------------- // Miranda Moore // COS488/MAT474 // Problem Set 10, Q3 //--------------------------------------------------------------------------- // The command "java Bitstring1" // plots the OGF for the set of bitstrings not containing the pattern // 0000000001. // // Dependencies: Complex.java, ComplexFunction.java, Plot2Dez.java //--------------------------------------------------------------------------- public class Bitstring1 implements ComplexFunction { // The OGF for bitstrings not containing 0000000001 public Complex eval(Complex z) { // {1 \over z^10-2z+1} Complex one = new Complex(1, 0); Complex two = new Complex(2, 0); Complex fifth = z.times(z).times(z).times(z).times(z); Complex tenth = fifth.times(fifth); Complex denom = tenth.minus(two.times(z)).plus(one); return denom.reciprocal(); } public static void main(String[] args) { Plot2Dez.show(new Bitstring1(), 512); } }