# Scalable Resource Provisioning Framework for Fog Computing Using LLM-Guided Q-Learning Approach
## 5 Expected Value Analysis
### Finite Fog Computing Scenario  
The finite fog computing scenario consists of \(N\) number of IoT device requests \(REQ=\left\{ \begin{array}{ll}Req_{1},&Req_{2},Req_{3},\ldots,Req_{n}\end{array} \right\}\), \(K\) fog computing nodes \(FN=\left\{ \begin{array}{ll}fn_{1},&fn_{2},fn_{3},\ldots,fn_{n}\end{array} \right\}\), and \(P\) resource provisioning policies \(\pi=<\pi_{1},&\pi_{2},\pi_{3},\ldots,\pi_{p}>\). The probability of the outcome of the objective functions varies between low, medium, or high \(P(OF)=<Low,Medium,High>\). **OF1: Processing Delay (PD(LLM_QL)):** The expected value of the processing delay of the proposed LLM_QL, i.e., EV(PD(LLM_QL)) is influenced by the expected value of the processing rate of the requests \(EV(PR(Req_{i}))\) and the expected value of the size of the requests \(EV(S(Req_{i}))\). \[EV\bigg{(}\frac{PD(LLM\_QL)}{\pi},\;\Delta T\bigg{)}=\int_{x}^{y}\frac{\sum_{ ac\pi}PD(LLM\_QL)(a)}{|\pi|}\]  
\[EV\bigg{(}\frac{PD(LLM\_QL)}{\pi},\;\Delta T\bigg{)}=\sum_{d\in D}d\int_{x}^{y} \frac{\sum_{ac\pi}PD(LLM\_QL)(a)}{|\pi|}\]  
\[EV\Big{(}\frac{PD(LLM\_QL)}{\pi},\;\Delta T\bigg{)}=\frac{EV\Big{(}1\times \pi\times\sum_{i=1}^{i-l}\frac{1}{PR(Req_{i})}\times S(Req_{i})\Big{)}}{\pi}\]  
\[=\int_{d}^{Q}Q\times dP\frac{\Big{[}\frac{1}{PR(Req_{i})}\Big{]}\times S(Req_{ i})\Big{]}}{\pi}\]  
**PD(LLM_QL):**\(EV\Big{(}\frac{PD(LLM\_QL)}{\Pi},T\Big{)}\cong\)_low_  
\[EV\bigg{(}\frac{PD(BAY\_L)}{\pi},\;\Delta T\bigg{)}=\int_{x}^{y}\frac{\sum_{ ac\pi}PD(BAY\_L)(a)}{|\pi|}\]  
\[EV\bigg{(}\frac{PD(BAY\_L)}{\pi},\;\Delta T\bigg{)}=\sum_{d\in D}d\int_{x}^{y} \frac{\sum_{ac\pi}PD(BAY\_L)(a)}{|\pi|}\]  
\[EV\bigg{(}\frac{PD(LLM\_QL)}{\pi},\;\Delta T\bigg{)}=\frac{EV\Big{(}1\times \pi\times\sum_{i=1}^{i=l}\frac{P((data\theta)\times P(\theta)}{P(data)}\Big{)} }{\pi}\bigg{)}\]  
**PD(BAY_L) = EV\Big{(}\frac{PD(BAY\_L)}{\Pi},T\Big{)}\cong\)_High_**  
\[EV\bigg{(}\frac{PD(CC)}{\pi},\;\Delta T\bigg{)}=\int_{x}^{y}\frac{\sum_{ac\pi }PD(CC)(a)}{|\pi|}\]  
\[EV\bigg{(}\frac{PD(CC)}{\pi},\;\Delta T\bigg{)}=\sum_{d\in D}d\int_{x}^{y} \frac{\sum_{ac\pi}PD(CC)(a)}{|\pi|}\]\[EV\bigg{(}\frac{PD(CC)}{\pi},\ \Delta T\bigg{)}=\frac{EV\Big{(}1\times\pi \times\sum_{i=1}^{i=1}f(x(t),r(t),P)\Big{)}}{\pi}\]  
where _f(x(t),r(t),P)_ = System state, Desired setpoint, and system parameters. \(\textbf{PD(CC)}=\textbf{EV}\Big{(}\frac{PD(FC)}{\Pi},\textbf{T}\Big{)}\cong \textbf{Medium}\)  
\[EV\bigg{(}\frac{PD(LLM\_QL)}{\pi},\;\Delta T\bigg{)}=\sum_{d\in D}d\int_{x}^{y} \frac{\sum_{ac\pi}PD(LLM\_QL)(a)}{|\pi|}\]0  
\[EV\bigg{(}\frac{PD(LLM\_QL)}{\pi},\;\Delta T\bigg{)}=\sum_{d\in D}d\int_{x}^{y} \frac{\sum_{ac\pi}PD(LLM\_QL)(a)}{|\pi|}\]1  
\[EV\bigg{(}\frac{PD(LLM\_QL)}{\pi},\;\Delta T\bigg{)}=\sum_{d\in D}d\int_{x}^{y} \frac{\sum_{ac\pi}PD(LLM\_QL)(a)}{|\pi|}\]2  
\(\textbf{PD(F\_QL)}=\textbf{EV}\Big{(}\frac{PD(F\_QL)}{\Pi},\textbf{T}\Big{)}\cong \textbf{High}\)  
**OF2: Energy Consumption (EC(LLM_QL)):** The expected value of the energy consumption of the proposed LLM_QL, i.e., \(EV(EC(LLM\_QL))\) is influenced by the expected value of the power required to process the input requests \(EV(PC(Req_{i}))\), workload allocated \(EV(WL(Req_{i}))\), and computational capacity of the fog node \(EV(CP(fn_{i}))\).