I’m not sure how could I write code for the following recurrence:
[a, b] --> [a, a*2/3, a*1/3+b*2/3, b];
[a, b, c] --> [a, a*2/3, a*1/3+b*2/3, b, b*2/3+ c/3, b/3+c*2/3, c]
that’s it, takes a list, and expands that as in the example. I’m not sure how can I write code for that. Could someone please help me with that?
Pretty easy: takes a list as input, and produces a list as output.