Machine installed with arduino suddenly turns on when usb is unplugged
Do not call loop from loop. You will quickly run out of RAM and the sketch will crash:



void loop(){

  int recipe;
  //Serial.print("Enter recipe number: ");

  while(Serial.available()==0){    // Waits for data from serial port
  }

  while(Serial.available() &gt; 0){
...

  }
  else
    loop();

}




For the pins that are supposed to be high, I suggest pull-up resistors:

  pinMode(6,OUTPUT);
  pinMode(7,OUTPUT);
  pinMode(8,OUTPUT);
  pinMode(9,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(11,OUTPUT);   // for start of program operation


  digitalWrite(6,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(8,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(10,HIGH);


When the Arduino powers up it enters the bootloader for a second or so. Those pins won't be set high yet. A pull-up resistor would make sure they are high until such time as you want to drive them low.



If you are saying that the machine powers up when you disconnect the power to the Arduino, that is still a good reason for using pull-up resistors, to make sure that it does not operated until commanded to do so.




  where will i connect the pull up resistors and how?


Typically pull-up resistors will be around 10k, and are connected from the pin to +5V. Of course, if the Arduino is not powered, then you need another source of the +5V.




  please to clarify the "do not call from loop to loop"


Remove these two lines:

else
    loop();


When loop exits, is it immediately re-called. You don't need to do it that way, in fact it is a Bad Idea.