%MA565 Assignment 1. Blackbox.m function y = blackbox(N, p) y(1) = 1.0/3.0; for i=2:N y(i) = p*y(i-1); end end