In knitting, ribbing is a pattern in which vertical stripes of stockinette stitch alternate with vertical…