YES We show the termination of the relative TRS R/S: R: average(s(x),y) -> average(x,s(y)) average(x,s(s(s(y)))) -> s(average(s(x),y)) average(|0|(),|0|()) -> |0|() average(|0|(),s(|0|())) -> |0|() average(|0|(),s(s(|0|()))) -> s(|0|()) S: rand(x) -> x rand(x) -> rand(s(x)) -- SCC decomposition. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: average#(s(x),y) -> average#(x,s(y)) p2: average#(x,s(s(s(y)))) -> average#(s(x),y) and R consists of: r1: average(s(x),y) -> average(x,s(y)) r2: average(x,s(s(s(y)))) -> s(average(s(x),y)) r3: average(|0|(),|0|()) -> |0|() r4: average(|0|(),s(|0|())) -> |0|() r5: average(|0|(),s(s(|0|()))) -> s(|0|()) r6: rand(x) -> x r7: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: average#(s(x),y) -> average#(x,s(y)) p2: average#(x,s(s(s(y)))) -> average#(s(x),y) and R consists of: r1: average(s(x),y) -> average(x,s(y)) r2: average(x,s(s(s(y)))) -> s(average(s(x),y)) r3: average(|0|(),|0|()) -> |0|() r4: average(|0|(),s(|0|())) -> |0|() r5: average(|0|(),s(s(|0|()))) -> s(|0|()) r6: rand(x) -> x r7: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7 Take the reduction pair: lexicographic combination of reduction pairs: 1. lexicographic path order with precedence: precedence: rand > average > |0| > s > average# argument filter: pi(average#) = [1, 2] pi(s) = 1 pi(average) = [1, 2] pi(|0|) = [] pi(rand) = [1] 2. matrix interpretations: carrier: N^4 order: lexicographic order interpretations: average#_A(x1,x2) = ((1,0,0,0),(1,1,0,0),(0,0,1,0),(0,1,0,1)) x1 + ((1,0,0,0),(1,0,0,0),(0,0,0,0),(1,0,0,0)) x2 s_A(x1) = ((1,0,0,0),(0,1,0,0),(1,0,0,0),(1,1,0,0)) x1 + (3,4,5,6) average_A(x1,x2) = ((1,0,0,0),(0,1,0,0),(1,0,0,0),(1,0,0,0)) x1 + ((1,0,0,0),(1,0,0,0),(1,0,0,0),(0,0,0,0)) x2 + (0,0,0,8) |0|_A() = (1,1,1,1) rand_A(x1) = (1,1,1,1) The next rules are strictly ordered: p1, p2 We remove them from the problem. Then no dependency pair remains.