For example ['A','B'] => 0.5 means that firm 'A' owns 0.5 (50%) of 'B'
The question is to define a method that allows you to determine how much of a firm a particular firm owns (directly and indirectly) through owning other firms. What I have determined so far:

For the sake of this example let's assume we are looking for total_ownership('A','E')

Obviously, this doesn't work. What I can't really figure out is how to "store" the values of each recursive level and how to set the base case correctly. If you can't help me with it in Ruby, I don't mind pseudo-code as well.