Exposure value EV100 = log₂(N²/t) + log₂(ISO/100). Anything with the same EV gives the same exposure, so you can trade aperture, shutter and ISO freely.
Depth of field uses the classical thin-lens result with hyperfocal distance H = f²/(N·c) + f, near limit s(H−f)/(H+s−2f), far limit s(H−f)/(H−s−2f). The circle of confusion is taken as the sensor diagonal divided by 1500, which for full frame gives the familiar 0.030 mm. Diffraction becomes visible around f/11 on full frame and much sooner on small sensors, so the sharpest aperture is usually a compromise with depth of field, not the smallest one.