Entropic Sampling of Free and Ring Polymer Chains