function [b]=produce_disc_basis(k)

% produce the basis for discontinuous functions 
%
%  HEHU XIE

syms x y v b A C

v=[];
for i=0:k
    for j=0:k-i
        v=[v,x^j*y^i];
    end
end
v
dim=size(v,2);
A=zeros(dim);
dim

for i=1:dim
    for j=1:dim
        A(i,j)=int(int(v(1,i)*v(1,j),x,0,1-y),y,0,1);
    end
end
A=A^(1/2);
b=v*inv(A);
v=b;
for i=1:dim
    for j=1:dim
        A(i,j)=int(int(v(1,i)*v(1,j),x,0,1-y),y,0,1);
    end
end
A
b=vpa(b,20);