You should use this hook in a custom module. You should also not tamper with core code as the Bartik theme directly. Also take a look at this: 

How do I save session data for the anonymous users?

How to call hook in template.php after login from any user in drupal 7?
I am trying to understand the following solution to CLRS 5.3-7:
http://clrs.skanev.com/05/03/07.html
Question description is on the page.  I understood the part where m-element subset is constructed out of m-1 element subset when the m-element subset includes the last element n.  But why does the probability of randomly choosing m-1 elements from a set of n-1 elements differs in the case when we don't include the last element?  Doesn't the invariant state that we choose m-1 elements at random from n-1 elements?
