close all; clear all;

% EES315 2020 Example 6.58
% EES452 2020 Examples 3.62, 3.67 (Figure 15)

C = [0 0 0 0 0; 1 1 1 1 1]; % repetition code

syms p; 
PE = PE_minDist(C,p)
expand(PE)

pp = linspace(0,0.5,100);
PE = subs(PE,p,pp);


plot(pp,PE,'LineWidth',1.5)
xlabel('p')
ylabel('P(E)')
grid on