Hallo Element 4 I am rather new here, in fact its my first post. I've been playing around with Arduino and various components for it. I was trying to understand transistors and looked up a few tutorials on it. Thus in all examples the transistors I bought behaved rather odd. I've made a schematic of my build on a breadboard where I use the Arduino as a power source and a NPN transistor and I am unsure of the part number so please ignore it on the first picture.
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>
At the picture most at the right thats how I understand a button switch to a transistor works. I know the transistor is rather pointless in this, but it was a good way to experiment with the transistor without changing code all the time 
However the odd behavior I was talking about just now is shown on the picture on the right. It yields the same resualt as picture on. As far as I understand an NPN transistor means the Collector have to be negative base should be possitive and the emitter should be negative to get an output. So in the drawing on the left it should nullify all cause its "PPN" and shouldn't light up the LED but it does.
I decided to try to make an AND gate to test some theory. The build looks like this:
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>
Whats happening here is this:
when I press A nothing happens. When I press B it lights up. If I press A and B it still lights up. Which is wrong for an AND gate. Can anyone please explain why it behaves like this? Did I buy the wrong set of transistors?

