I'm trying to solve the following problem on the random isomorphisms of trees – this comes from an old test that I found online. I state below the problem and my progress up to here. Any help is appreciated.

**Problem:**

A *rooted tree* is a tree in which a vertex is marked as root. Two rooted trees $ T_1 $ and $ T_2 $ they say to be *isomorphic* if there is one to one mapping (an isomorphism) $ f $ summits of $ T_1 $ to those of $ T_2 $, such as $ f (root (T_1)) $ = $ Root (T_2) $and for each vertex $ v $ of $ T_1 $ with children $ v_1, ldots, $ v_k, children (in $ T_2 $) of $ f (v) $ are exactly $ f (v_1), ldots, f (v_k) $ (in any order).

In this problem, you will design an efficient random algorithm to check if two given rooted trees are isomorphic. Given a rooted tree $ T $, define a polynomial $ P_v $ for each summit $ v $ of $ T $ recursively as follows. For each sheet $ v $, to define $ P_v equiv x_0 $. (Thus, all leaves have the same trivial polynomial.) For each non-leaf top $ v $ height $ h $ with children $ v_1, ldots, $ v_k, to define $ P_v equiv (x_h – P_ {v_1}) (x_h-P_ {v_2}) … (x_h-P_ {v_k}) $.

**(a)** For a tree $ T $ height $ h $ with $ m $ leaves, how many variables are there in the $ P_ {Root (T)} $, the polynomial at the root of $ T $? And what is the degree of this polynomial?

**(B)** Show that if two trees rooted $ T_1 $ and $ T_2 $ are isomorphic, so $ P_ {Root (T_1)} equiv P_ {Root (T_2)} $. (**hint:** Use induction on the height of the tree. You can assume that, if $ f $ is an isomorphism of $ T_1 $ at $ T_2 $ and $ v $ is a peak of $ T_1 $, then the sub-trees rooted in $ v $ and $ f (v) $ are also isomorphic.)

**(vs)** Show that if $ T_1 $ and $ T_2 $ are rooted trees and $ P_ {Root (T_1)} equiv P_ {Root (T_2)} $then $ T_1 $ and $ T_2 $ are isomorphic. (**hint:** Again, use the induction on the height of the tree. You can assume that, if a polynomial $ Q equiv (x – alpha_1) ldots (x – alpha_k) $, where the $ alpha $does not depend on $ x $Such a factorization is therefore unique, up to the order of the factors.)

**(re)** Give an efficient algorithm to test if two given rooted trees, $ T_1 $ and $ T_2 $ are isomorphic. If they are isomorphic, the result should be "yes"; if they are not, it should be "no" with at least one probability $ 1/2 $.

**Attempt:**

(a): There is $ h $ variables in $ P_ {Root (T)} $ (one variable per level in the tree). The polynomial is degree $ m $.

(b) and (c): I struggle with these two.

(d): With (b) and (c) we know that $ P_ {Root (T_1)} equiv P_ {Root (T_2)} iff T_1 $ and $ T_2 $ are isomorphic. This means that we can answer "yes" or "no" by asking $ P_ {Root (T_1)} equiv P_ {Root (T_2)}? $. Of course, this means that we can perform polynomial identity tests to check whether the two polynomials match. It is an application of the Schwartz-Zippel lemma. The algorithm would work as well as the multivariate polynomial identity test algorithm that satisfies the requirements of the question.