syntax of a function ...

syntax of a function ...

I state that are in the course of learning do jQuery ...
There are thousands of tutorials to write functions in a thousand different ways in file .js external... 
Someone can give me a hand?
  1. // Do something when the document it's ready (at the end) ...Correct?
  2. jQuery(document).ready(function(){
  3.       alert(' I am ready ');
  4. });

  1. // The document learn the function and when it is called do something ... Correct?
  2. function hello() {
  3.       alert(' hello ');
  4. }

But I don't understand what it means:

  1. jQuery(function($) {
  2.       ... 
  3. }  
or 
  1. (function($) {
  2.       ... 
  3. }(jQuery));


Examples are more accepted

Thanks a lot