Hello! I need to know how to represent this procedure mathematically. I am trying to have a program of mine published, but I need to represent this as an equation to the best of my abilities first!

I will first explain how the operation works, and then I will display my attempt at it.

We have two lists of elements: subjects and targets (i's & j's) These elements are actually protein sequences. We have two text files each containing our subjects and targets respectively

Now, we have two functions:
\displaystyle Sw(i,j) = R
\displaystyle Sw^\prime(i) = \{j_1,j_2,j_3\}

In other words, the Sw() function takes two elements : a subject sequence (i) and a target sequence (j) and returns a raw numerical bit-score called "R".

Now, the Sw'() function will take 1 subject sequence (i) and return 3 targets (j's).

Now, here is the procedure I need proper mathematical syntax: I have I written this in pseudo-code/python (lol)

from numpy import std,average,shuffle

answers = []
shuffled_Rs = []

def myscores(i):
  for j in Sw_prime(i):
    R = Sw(i,j)
    for i in range(500):
      shuffled_j = shuffle(j)
      shuffled_Rs.append( Sw(i,shuffled_j) )
    standard_deviation = std(shuffled_Rs)
    average = mean(shuffled_Rs)
    z_score = (R - average) / standard_deviation
  return answers
Each R value is normalized by generating 500 more bit scores with shuffled j's, then a standard score is calculated.

Long story short, I feed program one "i" value, and it will return 3 z-scores.
I need to represent this process mathematically. I can define the Sw, Sw' and Shuffle functions in text.

Here is how I attempted it:

Sw’ (i) = {j1, j2, j3} = T

Thanks a lot!