What is a witness? is it the same as a counterexample? A witness is a sequence of inputs that demonstrates…