Help, LED always on contrary to what I coded.

I wrote the following code to test my new p.i.r motion sensor. But the led is always on even when I have'nt connected anything at all.

const int ledPin = 13; 
const int PIr = 8;
void setup()
  pinMode(ledPin, OUTPUT);
  pinMode(PIr, INPUT);
void loop()
  if (digitalRead(PIr) == HIGH)
    digitalWrite(ledPin, HIGH);
    digitalWrite(ledPin, LOW);

Does it have something to do with using pull up or pull down resistors. If so tell me what pull down or pull up resistors are(I've no idea what they are, but have seen them on tutorials).

EDIT: I used ladyada's code on pir sensor and it too went HIGH and LOW when I did not connect anything, but worked fine after I plugged in the P.Ir sensor. Can any one tell me what is wrong. Is it due to noise ?

But the led is always on even when I have’nt connected anything at all.

If the LED is on when it is not connected, it is faulty.

You have not enabled the internal pullup resistor, so the input pin is probably floating. It definitely is when the PIR is not connected.

I used ladyada’s code on pir sensor

Did you use her wiring scheme? What is it?

The input with nothing connected to it will be floating, so you'll probably get random values from it when you read its state. There's something on this page about it: