#Shaurya Baranwal, Homework 27 due on April 28, 2024 # ---------------------------- # Part 2 - MetaZKP3(n,E,C,K) | # ---------------------------- MetaZKP3 := proc(n, E, C, K) local ra, i: ra := rand(1..2): for i from 1 to K do if ZKP3(n, E, C, ra()) = false then return false: fi: od: true: end: # Testing with proper colorings n := 0: E := 0: C := 0: success := true: for i from 1 to 20 do n, E, C := RGC3(i): if MetaZKP3(n, E, C, 20) = false then success := false; break; fi: od: print(success); # true was the output # Testing with improper colorings n := 0: E := 0: C := 0: ra := rand(1..3): success := true: for i from 1 to 20 do n, E, C := RGC3(i): C := [seq(ra(), j = 1..i)]: if MetaZKP3(n, E, C, 20) = false then success := false; break; fi: od: print(success); # false was the output