Thanks that's really helpful!
Just out of curiosity, why don't we use diodes instead?
I tried these pull-up / pull-down cicuits on a simulator with 10Meg resistors and they still work. So then I thought a diode could replace the large resistor and
it still worked.
mmm....?