title: Getting Percentage of TypeOf Item in a List with LINQ
body: <p>I want to be able to get the percentages of certain types of things in a list. </p>
  
  <p>Say I have a list of Animals, but inside that list I have Cats, Dogs, And Snakes: </p>
  
  <pre><code>List&lt;Animal&gt; animals = new List&lt;Animal&gt;{
  new Cat { Name="Cuddles", Sound=Sound.Meow, Age=3 },
  new Dog { Name="Spot", Sound=Sound.Bark, Age=7 },
  new Cat { Name="Karma", Sound=Sound.Meow, Age=10 },
  new Snake { Name="Nagini", Sound=Sound.Hiss, Age=1 },
  new Dog { Name="Sparky", Sound=Sound.Bark, Age=4},
  new Cat { Name="Matty", Sound=Sound.Meow, Age=15}
  };
  </code></pre>
  
  <p>And I want to be able to get the percentages of these animals, so a potential result set would be:</p>
  
  <pre><code>Cats: 0.50
  Dogs: 0.35
  Snakes: 0.15
  </code></pre>
  
  <p>But I'm not really sure how to get this type of result set. Especially if I just wanted to get the percentage of Cats. </p>
  
  <p>I know I need to use <code>list.OfType&lt;Cat&gt;()</code> to pull the list of just cats, but that's also when I'm having trouble getting the percentage of Cats, because I cant use .Sum() or .Average().</p>
  
  <p>Any ideas?</p>