Urn Models applied to Linear Codes and Economic Statistics