# ExCrowd: A Blockchain Framework for Exploration-Based Crowdsourcing
## 6 Computing Reward Distribution  
It is imperative to appropriately compensate all employees, especially when their contributions are varied. To overcome the problem of reward distribution, certain solutions have been devised. The Shapley value is the most potent of these strategies. Shapley is used when each worker's contributions are unequal, yet the overall task is completed collaboratively by all of the workers involved. The Shapley value is an estimate that represents the average expected marginal contribution of one participant after all possible combinations have been explored. The Shapley value has been shown to be a reasonable method of assigning value.  
The worker set is denoted by K, and the number of employees is given by \(|K|\). \(\omega\) denotes a worker group and is a non-empty subset of \(K\). The group's worth function \(K\) is given as \(u(\omega)\), indicating the group's input. We use \(\theta_{i}\) to represent the \(i\)-th worker who does not belong to group \(\omega\). As a result, the marginal contribution \(\theta_{i}\) of the group \(K\) is defined as:  
\[u(\omega,i)=u(\omega\cup\{i\})-u(\omega) \tag{6}\]  
Equation (5) defines the Shapley value.  
\[\rho(\theta_{i})=u(\omega,i)\sum_{\omega\in\omega_{i}}\frac{(|K|-|\omega|-1)! |\omega|!}{|K|}u(\omega,i) \tag{7}\]  
\(\omega_{i}\) contains all subsets of \(\vartheta\) except for \(\theta_{i}\). It is critical that incentives are distributed properly based on the efforts of the workers. We will use data collection and picture annotation as examples to assess each worker's participation. The more data samples collected in a data collection process activity, the more accurate the task's ultimate outcome. As a result, samples obtained after the first are less significant. Consequently, we use Equation (6) function to calculate the contribution.  
\[H(\gamma)=1-e^{-\
u_{1}\gamma} \tag{8}\]  
\(\gamma\) denotes the number of samples submitted by a worker. For instance, \(\theta_{1}\) submits six samples initially, followed by \(\theta_{2}\) uploading three samples. To make the problem easier to understand, we define \(v_{0}\) as 1. The input of \(\theta_{1}\) is \(1-e^{-6}\). The overall input of \(\theta_{1}\) and \(\theta_{2}\) is \(1-e^{-9}\). Therefore, the input of \(\theta_{2}\) is \(1-e^{-9}-(1-e^{-6})\). If \(\theta_{2}\) first submits their samples, the input of \(\theta_{2}\) is \(1-e^{-3}\). Furthermore, the input of \(\theta_{1}\) whose samples is 5 is \(1-e^{-9}-(1-e^{-3})\). Equation (5) can be used to compute the contribution of each worker. We show the algorithm for distributing rewards in Algorithm 2.  
```
1:INPUT: Workers,TaskAddress(TA)
2:OUTPUT:\([m_{1}\cdots m_{n}]//\)Allocate reward to respective workers
3:\(N_{w}\leftarrow\) Number of workers
4:\(id\leftarrow\) Index of workers(TA)
5:\(P_{c}\leftarrow\) Possible Coalitions(TA)
6:\(P_{p}\leftarrow\) Possible number of workers in coalition(TA)
7:\(T_{c}\leftarrow\) The total of possible number of workers in coalition
8:\(V(P_{c})\leftarrow\) Value of coalition;
9: Determine \(N_{w},id,P_{c},P_{p},V(P_{c})\);
10: Create Matrix[];
11:for\(q=1\) to \(T_{c}\)do
12:for\(r=1\) to \(N_{w}\)do
13: Estimate the submission of workers to coalitions with \(P_{p}\) workers
14:endfor
15: Estimate the probability of coalition with workers \(P_{p}\) workers
16: Accumulate total reward of the task(TA)
17:endfor
18:Shapely value \(\leftarrow\) accumulated reward of the task
19:return\(m\gets reward\)
```  
**Algorithm 2** Algorithm for distributing rewards