How is compression ratio related to number of dct coefficients Lets say we have a picture with 6bits/pixel and we use discrete cosine transform with 8x8 blocks of pixels and each coefficient is 8 bits. We can use 2 8x8 masks, a zonal mask A and a zonal bit allocation mask B. 

A = [1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...... ]
B = [8 7 6 4 3 2 1 0 7 6 5 4 3 2 1 0 6 5 4 3 3 1 1 0 4 4 3 3 2 1 0 0 3 3 3 2 1 1 0 0 2 2 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0  ]

Is it correct to say that for A we have 64 : 15 compression namely 4.2 : 1 cause we keep 15 coefficients out of 64? does the same apply for B ?
Compression ratio is defined as the amount of bits in the original image divided by the amount of bits in the compressed image. In the original image the number of coefficients is 64, while you choose 15 coefficients after DCT in the compressed image with mask A. The ratio is 64*6/15*8. With mask B it is 64*6/41*8