YES

We show the termination of the relative TRS R/S:

  R:
  p(s(x)) -> x
  fac(|0|()) -> s(|0|())
  fac(s(x)) -> times(s(x),fac(p(s(x))))

  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: fac#(s(x)) -> fac#(p(s(x)))
p2: fac#(s(x)) -> p#(s(x))

and R consists of:

r1: p(s(x)) -> x
r2: fac(|0|()) -> s(|0|())
r3: fac(s(x)) -> times(s(x),fac(p(s(x))))
r4: rand(x) -> x
r5: rand(x) -> rand(s(x))

The estimated dependency graph contains the following SCCs:

  {p1}


-- Reduction pair.

Consider the non-minimal dependency pair problem (P, R), where P consists of

p1: fac#(s(x)) -> fac#(p(s(x)))

and R consists of:

r1: p(s(x)) -> x
r2: fac(|0|()) -> s(|0|())
r3: fac(s(x)) -> times(s(x),fac(p(s(x))))
r4: rand(x) -> x
r5: rand(x) -> rand(s(x))

The set of usable rules consists of

  r1, r2, r3, r4, r5

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        rand > |0| > fac > s > times > p > fac#
      
      argument filter:
    
        pi(fac#) = 1
        pi(s) = 1
        pi(p) = 1
        pi(fac) = [1]
        pi(|0|) = []
        pi(times) = 1
        pi(rand) = [1]
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        s > rand > times > |0| > p > fac > fac#
      
      argument filter:
    
        pi(fac#) = [1]
        pi(s) = [1]
        pi(p) = 1
        pi(fac) = 1
        pi(|0|) = []
        pi(times) = [1]
        pi(rand) = []
    
    3. lexicographic path order with precedence:
    
      precedence:
      
        rand > times > fac > fac# > s > |0| > p
      
      argument filter:
    
        pi(fac#) = [1]
        pi(s) = [1]
        pi(p) = []
        pi(fac) = []
        pi(|0|) = []
        pi(times) = [1]
        pi(rand) = []
    

The next rules are strictly ordered:

  p1

We remove them from the problem.  Then no dependency pair remains.