Introduction to Monte Carlo concepts & basic techniques -
Shot noise & thermal noise

ECE generic - segment 1

1. Introduction: a simple problem

First, a description of the background.

https://www.youtube.com/watch?v=Sh1ZeWhAtRI

Let’s assume that all the raindrops were lemondrops and gumdrops, and the kids all stood outside with mouths open wide. Assume that all the kids have mouth of the same size, which is:

π * (((1.5 inch))^2)

or 7 (inch^2). Let the lemon/gumdrops density is 1 (lemon or gumdrop)/(inch^2) per 10 minutes. If we have 100 kids all stand outside with mouth open wide for 15 minutes, how many lemon or gumdrops would each kid catch? (Think about what  right questions are - Asking the right questions is 80% of the work). How to solve this problem?

1.1 Discussion

First, we can think of the average of lemon/gum drops that each kid can get. The average is easy to calculate:

((1 "lemongumdrop")/((inch^2) * 10 minutes))*π * (((1.5 inch))^2)*15 minutes

But does that mean every kid would get exactly 10.6 lemon/gumdrops? If we count the number of “raindrops” each kids get, and tabulate on a histogram, do they all get 10, 11? or would some get 5, other would get 15 etc... Is it possible for some to get 20?

How do you answer the questions above. Or could it be that it doesn’t have an answer? If you have several groups of 10,000 kids each, for example. Would there be a common pattern, or some unique shape in all of their histograms? Or will the histograms be totally random and completely different from each other? 
In the follow, you should follow the guidelines to gain an understanding and see if you can answer those questions at the end.

One way to study this problem is the Monte Carlo method:

1.2 Computer simulation

We can use the computer to simulate 100 kids’ mouths and rain drops.

Here are the mouths:

Grid[{{mouth=Graphics[{Hue[0.08,0.3,1],Table[Disk[3*{m,n}+{1.5,1.5},1.5],{m,0,9},{n,0,9}]}
,Background->Hue[0.65,1,0.4], ImageSize-> 400]
,Grid[ConstantArray[,{10,10}],Spacings-> {0.1,0.1}]}}]

The left handside is the model of the right handside that is easier for counting (lest the right hand side swallow lemon/gumdrops before we finish counting). Next, let’s make lemongumdrops:

dropdensity=(1./(10 minutes))*15 minutes; nkidrow=10;mouthradius=1.5; 
kidgroupside=nkidrow*2*mouthradius;
ndrop=RandomVariate[PoissonDistribution[(kidgroupside^2)*dropdensity]]; (* total drops *)
lgpt=RandomReal[{0,kidgroupside},{ndrop,2}];
lemongumdrop=Graphics[{Hue[0.9,1,1],PointSize[0.01],Point /@ lgpt }]

Now, let’s see who catch what by putting mouths and lemongum raindrops together:

Show[mouth, lemongumdrop]

We will count for each mouth:

mouthradius=1.5; rsquare=(mouthradius^2);
catch=Reap[Do[
v=Reap[Do[c=3 {m,n}+{1.5,1.5};
dist=Table[(x-c) . (x-c),{x,lgpt}] ;
u=Select[dist,#≤ rsquare &];
Sow[Length[u]]
,{m,0,9}]][[2,1]];
Sow[v]
,{n,0,9}]][[2,1]] ;
catch1=Flatten @ catch;
Grid[{{Show[mouth, lemongumdrop,ImageSize-> 400]
,Show[mouth,Graphics[Table[Text[Style[catch[[m+1,n+1]],18,Hue[((catch[[m+1,n+1]]-Min[catch1])/(Max[catch1]-Min[catch1]+1)),1,0.7]],3*{n,m}+{1.5,1.5}],{m,0,9},{n,0,9}]],ImageSize-> 400]}}]

There we have it. Lucky kids could get 18, 19 or more. Less lucky ones got 5 or less. Let’s check the histogram

Grid[{{Histogram[catch1,{1},ImageSize-> 350 ]
,Histogram[catch1,{1},ChartStyle->{Hue[0.16,1,1.,0.8],Hue[0.8,0.7,1,0.8]}, Frame-> True, FrameStyle-> Black, GridLines-> Automatic
,Prolog->Inset[Show[,ImageSize-> 360]],ImageSize-> 350]
}}]

We see that the lucky ones could catch several times more than the unlucky ones. The mean is:

Mean @ catch1*1.

To improve statistics, we can run the simulation with larger sampling populations. The code below is for 2500 kids (use your discretion to decrease the size if the computer takes too long). Based on your result, find:
- what is the chance for a kid to get only 4 candies? (of course, under the same condition: 1 candy/(inch^2) per 10 minutes and the kid stands for 15 minutes).
- what is the chance to get exactly 10? (many think it is about 50%-50% and that is very wrong).
- what is the chance to get 15 and 20, respectively 
- show your histogram(s).

Here is the code for 2500 kids (50 by 50). (Written a little longer than the above for faster execution. On slower computers, reduce nkidrow to 30 or 25, for example)

1.3 Computer simulation - higher sample polulation

dropdensity=(1./(10 minutes))*15 minutes; nkidrow=50;
mouthradius=1.5; mouthdiam=2*mouthradius;rsquare=(mouthradius^2);
kidgroupside=nkidrow*mouthdiam;
ndrop=RandomVariate[PoissonDistribution[(kidgroupside^2)*dropdensity]]; (* total drops *)
lgpt=Sort @ RandomReal[{0,kidgroupside},{ndrop,2}];
(* if graphics is needed
lemongumdrop=Graphics[{Hue[0.9,1,1],PointSize[0.005],Point /@ lgpt }] *)
starttime=Date[];
x0= lgpt;
catch2=Reap[Do[
xs=Select[x0,(m-1)*mouthdiam  ≤ #[[1]]< m* mouthdiam & ];
x0=Drop[x0,Length[xs]];
ys0=Sort @ ( Transpose @(Reverse @ Transpose[xs]));
If[Length[x0]==0, Break[],];
Do[cent={2m-1,2n-1}*mouthradius;
ys=Select[ys0,(n-1)*mouthdiam  ≤ #[[1]]< n*mouthdiam & ];
v=Transpose@ (Reverse @ Transpose[ys]);
Sow[Length @ Select[v,(#-cent) .(#-cent) ≤ rsquare &] ];
ys0=Drop[ys0,Length[ys]];
If[Length[ys0]==0, Break[],];
,{n,nkidrow}];
,{m,nkidrow}]][[2,1]] ;
(* catch2=Flatten @ catch ;  total2=Total[catch2]; *)
Grid[{{Style["time taken: ",20, FontFamily->"Calibri"],Take[Date[]-starttime,-2] . {60,1}}}]
Histogram[catch2,{1},ImageSize-> 350 ,Frame-> True,ChartStyle->"BrightBands"
,FrameLabel->{"number of caught items",}
,Background->Black, FrameStyle->White]

2. Poisson distribution

2.1 Discussion

As one can see from 1.2 and 1.3 above, the distribution is quite consistent as we run the code several times. In fact, it has a name: Poisson distribution.

You can read up an interesting application during WW2 when the British tried to determine if German V-1 and V-2 bombers were sufficiently accurate navigationally, to target high-value facilities: https://www.britannica.com/topic/Poisson-distribution

For a given mean value (Subscript[n, μ]) (such as the expected average of the candies per kid), the probability for n candies is:
                                                  P[n]=(((Subscript[n, μ])^n)/(n!))(e^(-(Subscript[n, μ])))

2.2 Demo 1: using Mathematica built-in Poisson distribution function

Below is a demo that uses built-in Poisson distribution of Mathematica. You can see the distribution reaches certain shape as n-> 10,000.

code

Manipulate[
If[TrueQ[RUNPOISSONexamp== ],

Manipulate[
If[!TrueQ[{mean0,nkids0}=={mean,nkids}]
,xrange1={0.,Ceiling[(mean+3*Sqrt[mean])*0.2]*5} ;
generaterandomsample=True;
{mean0,nkids0}={mean,nkids}
,];
If[TrueQ[generaterandomsample],
xpoisson=RandomVariate[PoissonDistribution[mean],nkids];
pmax=1.5*((mean^mean) (E^(-mean)))/mean!;
generaterandomsample=False
,];
hp=Show[Histogram[xpoisson,{1},htype
,PlotRange-> {xrange1,{0.,pmax}}
,PlotLabel-> Style["number of candies per kid",18]
,Frame-> True, FrameStyle-> Black, GridLines-> Automatic
,Epilog->Inset["number of kids "<>ToString[nkids],ImageScaled[{0.75,0.65}]
,BaseStyle->{18,FontFamily-> "Calibri"},Background->Hue[0.32,0.5,1]]]
,If[htype=="Probability"
,Graphics[{Red,PointSize[0.02],Point /@ Table[{m,((mean^m)/(m!))(E^(-mean))},{m,Ceiling[3. mean]}]}]
,Graphics[{Blue,PointSize[0.02],Point /@ Table[{m,Log[((mean^m)/(m!))]-mean},{m,Ceiling[3. mean]}]}]]
,PlotRange-> If[htype=="LogProbability",{xrange1,{Log[(10.^(-4))],Log[2. pmax]}}
,{xrange1,All}]]
,{{mean,10.6},3.,50.}
,Grid[{{Control[{htype,{"Probability","LogProbability"}}]
,Button["generate new simulation",generaterandomsample=True]}}]
,{nkids,{100,500,1000,2000,5000,10000},ControlType->SetterBar }]
,Style["slide to start demo of Poisson distribution",20,Italic,FontFamily->"Calibri"]]
,Grid[{{Style["Poisson Demo. 1",24,FontFamily->"Century Gothic"],Control[{{RUNPOISSONexamp,,},{,},ControlType->Toggler}] }}]
,Initialization:>{
generaterandomsample=True;
xrange1={0.,35.};
}
]

2.3 Exercise/demo: 1-dimension uniform random distribution

Exercise

Generate 5000 RandomReal betweet 0 and 1, sort them into 1000 bins, from [0-0.001), [0.001-0.002),...[0.999-1). Count the number in each bin and make a histogram

Answer

Manipulate[
If[TrueQ[newsample2],
xpt2=Sort @ RandomReal[{0,1},5000];
x0=xpt2;
{xintv,ndist}=Reap[Do[u=Select[x0,(m-1)*0.001≤#< 0.001m & ];
nx=Length[u];
x0=Drop[x0,nx];
Sow[Transpose[{u,ConstantArray[0.,nx]}],A];
Sow[nx,B];
If[Length[x0]==0,Break[],];
,{m,1000}]][[2]];
newsample2=False;
hist=Histogram[ndist,{1},PlotRange->All];
iready=True,
];
xpt=Join[xintv[[m-1]],xintv[[m]],xintv[[m+1]]];
Grid[{{Dynamic[If[iready== False,ProgressIndicator[Clock[]],""]],}
,{Show[hist
,Graphics[{Hue[0.55,1,1,0.7],Rectangle[{ndist[[m]]-0.2,0},{ndist[[m]]+0.2,200}]}]]
,Graphics[{Hue[0.15,1,1,0.4]
,Rectangle[{(m-1)*0.001,-0.0002},{m*0.001,0.0002}]
,Red,Opacity[1], PointSize[0.025]
,If[Length[xpt]>0,Point /@ xpt ,bogus]
,Text[Style["bin "<>ToString[m],15,Black],{0.001*(m-0.5),0.0005}]
,Text[Style["# pts:   "<>ToString[ndist[[m]]],15,Black],{0.001*(m-0.5),0.0003}]}
,PlotRange->{{m-1.5,m+0.5}0.001,{-0.0002,0.0008}}]
}}]
,Button["generate new sample population",newsample2=True;iready=False]
,{m,2,1000-1,1}
, Initialization:>{newsample2=True}]

2.4 Asymptotic approximation for large mean

In practice, when mean (Subscript[n, μ]) is large, such as >50, Poisson distribution can be conveniently approximated with a Gaussian:
                                                  P[n]=(((Subscript[n, μ])^n)/(n!))(e^(-(Subscript[n, μ]))) -> (1/(σ(Sqrt[2π]))) (e^(-((((n-(Subscript[n, μ])))^2)/(2 (σ^2))))) where σ=(Sqrt[(Subscript[n, μ])])

Manipulate[
σ=(Sqrt[μ]);
Show[Plot[(1./(σ(Sqrt[2π]))) (E^(-(1/2)(((((x-μ)/σ)))^2))),{x,μ-4 σ,μ+4 σ}
,PlotStyle->{Thickness[0.005],Hue[0.65,1,1]}]
,Graphics[{Hue[0.,1,1,0.67],PointSize[0.02]
,Table[Point[{m,((μ^m)/(m!))(E^(-μ))}],{m,Max[0,Floor[μ-4 σ]],Ceiling[μ+4 σ]}]
}]]

,{{μ,50.},5.,100.}]

3. Electrical current: Drude model

3.1 Review: Drude model of electron transport

Consider the Drude model below for electrical conduction:

3.2 Poisson fluctuation

In the app above, if we count the number of electrons crossing a point per a given time interval Δt, will we obtain exactly the same # of electrons everytime? Clearly, we won’t. The number of electrons per time interval will fluctuate. For simplicity, we’ll treat all electrons as having the same drift velocity. Then we have the demo below

Manipulate[
If[TrueQ[SHOTNoise== ],
Grid[{{
Manipulate[
{xptr,yptr0}=Transpose[Sort @ RandomReal[{0,1},{dens0,2}]];
yptr=yptr0*0.02; dens=dens0;

If[!TrueQ[{dens0old,dtold}=={dens0,dt}] && TrueQ[HIST2],
hist2ready=False;
nsh=Ceiling[200*dt]; xrange={0.,1.*nsh};μP2=dt*dens0;
binrange={Max[0,Floor[μP2-3 (Sqrt[μP2])]],Ceiling[μP2+3 (Sqrt[μP2])]};
xs2=Sort @ RandomReal[xrange,dens0*nsh];
h2data=poissCount[{xs2,xrange},dt];
hgr2=Show[Histogram[h2data,{1},"Probability",PlotRange->All]
,Graphics[{Red,PointSize[0.03]
,Table[Point[{m,(((μP2)^m)/(m!))(E^(-μP2))}],{m,binrange[[1]],binrange[[2]]}]
}],PlotRange-> {binrange,All}
,ImageSize-> 300];
 hist2ready=True;
{dens0old,dtold}={dens0,dt}
,];
Column[{Row[{Button["show histogram",HIST2=!HIST2;
If[TrueQ[HIST2],hist2ready=False,];
,BaseStyle-> {18,White,FontFamily->"Century Gothic"}
,Background->Hue[0.03,1,0.35]],,,,,,}]
,If[TrueQ[HIST2] ,If[ hist2ready,hgr2,ProgressIndicator[Clock[]]]
,]}]
,{{dens0,100,"density"},100,500,50
,ImageSize-> 100}
]
,Manipulate[
dt=Min[Max[Δt,0.01],0.2];
If[ !TrueQ[dt0==dt],If[TrueQ[HIST2],HIST2=False,]; dt0=dt,];
ys=10. dt;μn=dens*dt;
nmax=Ceiling[0.2*(μn+3 Sqrt[μn])]*5;

ne=Length[Select[Mod[xptr+t,1],0.5-0.5 Δt≤#<0.5+0.5 Δt &]];
Grid[{{Graphics[{Hue[0.15,0.4,1]
,Rectangle[{0.5-Δt,-0.005 ys},{0.5+Δt,0.025 ys} ]
,Black,Arrowheads[{-0.06,0.06}],Thickness[0.005]
,Arrow[{{0.5-0.5Δt,0.03 ys},{0.5+0.5Δt,0.03 ys}}]
,Text[Style["Δt",18,FontFamily->"Times New Roman"],{0.5,0.04 ys}]
,Hue[0.35,1,1,0.4]
,Rectangle[{0.5-0.5Δt,-0.005 ys},{0.5+0.5 Δt,0.025 ys} ]
,Hue[0.65,1,1,1],Thickness[0.005],Dashed
,Line[{{0.5,-0.02 ys},{0.5,0.04 ys}}]
,Red,PointSize[0.02]
,Point /@ Transpose[{Mod[xptr+t,1],ys*yptr}]}
,PlotRange->{{0.5-Δt,0.5+Δt},{-0.02,0.055} ys}
,ImageSize->300]
,Graphics[{Hue[0.5,0.65,1]
,Rectangle[{0,0},{5,ne}]}
,PlotRange->{{0,5},{0,nmax}}
,Frame->True
,FrameTicks->{False,True}
, ImageSize->50, AspectRatio->2.5]
}},Alignment->Center]
,{t,0,1},{{Δt,0.1},0.01,0.2}]
}},Alignment->Top]

,Style["slide to start demo of Drude electron model",20,Italic,FontFamily->"Calibri"]]
,Grid[{{Style["shot noise demo",24,FontFamily->"Century Gothic"],Control[{{SHOTNoise,,},{,},ControlType->Toggler}] }}]
,Initialization:>{
generaterandSN=True;HIST2=False;
{dens0old,dtold}={-1,-1};hist2ready=False;
poissCount[{xdat_,xrng_},dx_]:=Block[{x0,nr,u,nx},
x0=xdat;nr=Floor[Abs[(xrng[[2]]-xrng[[1]])/dx]];
Reap[Do[u=Select[x0,xrng[[1]]+(m-1)*dx≤#<xrng[[1]]+ dx m & ];
nx=Length[u];
x0=Drop[x0,nx];
Sow[nx];
If[Length[x0]==0,Break[],];
,{m,nr}]][[2,1]]
];
}
]

4. Shot  noise

4.1 Discussion

As illustrated in 3.2, the number-of-electrons fluctuation per measurement interval Δt means current fluctuation.

4.2 Current shot noise app

4.3 Dark current of detector: an example

Suppose we have a robot that uses a lidar to probe its surrounding. It sends out laser pulses with 1-ns duration. It has a receiver (optical detector) with a responsivity of 0.5 A/W, with a dark current of 1 mA. (0.5-A/W responsivity means that for every watt of optical power incidents on it, it yields 0.5-A current; and 1-mA dark current means that even without any light, i. e. zero optical power, it still yields a steady current of 1 mA).

Calculate the number of electrons of dark current during one laser pulse.

Hint: use this formula:         (Subscript[n, dark])= (((Subscript[i, dark]) Δt)/e)

Answer

eC=1.6023*10^-19; idark=10.^-3; Δt=10^-9;
μdark=((idark*Δt)/eC)

4.4 Lidar signal current

The laser backscattered power on the detector is  0.5 μW. Multiply this with the responsivity to get signal current. Then, calculate the number of signal electrons for one laser pulse. (Use the same formula above, but (Subscript[i, signal]) instead of (Subscript[i, dark])).

Answer

eC=1.6023*10^-19; 
Resp=0.5 ; ilaser=0.5*10^-6 ;Δt=10^-9;
isignal=ilaser*Resp ;
μsignal=((isignal*Δt)/eC)

4.5 Simulation

The total electrons = lidar signal electrons + dark current electrons.

- generate xdark=200 samples of dark current electrons, using Gaussian approximation of Poisson’s distribution, which is:          p[x]= (1/(σ(Sqrt[2 π])))(e^(-((((x-μ))^2)/(2 (σ^2)))))  where μ is the average # of dark electrons and σ=(Sqrt[μ]).

- generate xsignal=200 samples of total electrons that include both dark and lidar electrons, using the same formula but with μ being the average of total electrons.
- ListLinePlot both in the same plot. Discuss if you can see any difference between them (which is the lidar current).

Answer

xdark=RandomVariate[NormalDistribution[μdark,(Sqrt[μdark])],200];
xsignal=RandomVariate[NormalDistribution[μdark+μsignal,(Sqrt[μdark+μsignal])],200];

ListLinePlot[{xdark,xsignal},PlotStyle-> {Red,Blue},PlotRange->All]

Discussion: It is clear that the signal is too small compared with the noise and it is hard to see any difference.

4.6 Signal accumulation

Instead of measuring with just one pulse, we can accumulate many pulses. Use the same code above, but allow Ns, the number of pulses, be “Manipulatable”. Vary Ns from 1 to 100 and discuss what you find.

Plot a histogram for each of these two cases:
1- data of dark electrons # and total electrons # with 1 pulses. (histogram of xdark and xsignal in the same plot, each with different color, use the 200 pts you generate above.)
2- same as above with accumulated data with 100 pulses.
Compare the SD of the two distributions for the two cases and discuss (remember the (Sqrt[(Subscript[N, S])]) rule. When you increase the number of samples 100 times, the total increases linearly, but the SD increases only as the square root of it. If you take the average by dividing the mean by the number of samples, then the mean stays the same:  μ->((μ (Subscript[N, S]))/(Subscript[N, S]))=μ    , but the SD->((σ (Sqrt[(Subscript[N, S])]))/(Subscript[N, S]))=(σ/(Sqrt[(Subscript[N, S])]))  ).

Answer

Manipulate[
xdark=RandomVariate[NormalDistribution[μdark Ns,(Sqrt[μdark Ns])],2000];
xsignal=RandomVariate[NormalDistribution[(μdark+μsignal)Ns,(Sqrt[(μdark+μsignal)Ns])],2000];
{ListLinePlot[{xdark,xsignal},PlotStyle-> {Red,Blue},PlotRange->All
,ImageSize->400]
,Rotate[Histogram[{xdark,xsignal},40,ChartStyle-> {Red,Blue},PlotRange->All
,Frame-> True, GridLines-> Automatic,ImageSize->250],Pi/2]}
,{Ns,1,100,1}
,Initialization:>{
eC=1.6023*10^-19; idark=10.^-3; Δt=10^-9;
μdark=((idark*Δt)/eC);
Resp=0.5 ; ilaser=0.5*10^-6 ;Δt=10^-9;
isignal=ilaser*Resp ;
μsignal=((isignal*Δt)/eC);
}]

5. Johnson  noise: an example

5.1 Discussion

Note: use the APP on noise to gain a gut feeling about thermal noise.

Electrons in a medium above absolute-zero temperature do not rest, but agitate randomly (quantum mechanically). Thus, there is a fluctuating current, of which the average is zero, but not the mean square. The kinetic energy of electrons ~ ∝(Subscript[k, B])T. The noise power is:                         
                                   (Subscript[P, thermal])=4 (Subscript[k, B])T B=2(((Subscript[k, B])T)/(Δt))
where (Subscript[k, B]) is the Boltzmann’s constant and B is the measurement bandwidth, which is (1/(2 Δt)) if we think in terms of sampling duration. If the curcuit resistor is R, then:  
                                       (Subscript[P, thermal])=((Subscript[i, th])^2)R=4 (Subscript[k, B])T B      
Or:                             ((Subscript[i, th])^2) =((4 (Subscript[k, B])T B)/R)  ;    (Subscript[i, th])=(Sqrt[((4 (Subscript[k, B])T B)/R)]) 
In terms of voltage,          (Subscript[P, thermal])=(((Subscript[v, th])^2)/R)=4 (Subscript[k, B])T B    ;      (Subscript[v, th])=(Sqrt[4 (Subscript[k, B])T B R]) =R (Subscript[i, th])                                                          (Subscript[k, B])=1.38065×10^-23 Joule/Kelvin; and for future reference, electron charge =1.6023*10^-19 C.

5.2 Johnson noise: an exercise

Write a computer program to calculate the current noise and voltage noise at least 4 cases: bandwidth B= 100 kHz and 10 MHZ; impedance R 50 Ohm and 1 MOhm. Let T=300 K. (2 cases of BW x 2 cases impedance = 4 combinations).

Answer

kB=1.38065*10^-23 ; T=300.; B={10.^5,10.^7};R={50.,10.^6};
current=Grid[Join[{{Style["Noise current (nA)",Bold],"R=50 Ω","R=1 MΩ"}},MapThread[Prepend,{Sqrt[4 kB*T*Outer[Times,B,1./R]]*10^9
,{"B=100 kHz","B=10 MHz"}}]]
,Frame-> All,BaseStyle->{20,FontFamily-> "Calibri"}
,Background->{{Hue[0.16,1,1],},{Hue[0.4,1,1],}}]

kB=1.38065*10^-23 ; T=300.; B={10.^5,10.^7};R={50.,10.^6};
voltage=Grid[Join[{{Style["Noise voltage (μV)",Bold],"R=50 Ω","R=1 MΩ"}},MapThread[Prepend,{Sqrt[4 kB*T*Outer[Times,B,R]]*10^6
,{"B=100 kHz","B=10 MHz"}}]]
,Frame-> All,BaseStyle->{20,FontFamily-> "Calibri"}
,Background->{{Hue[0.5,0.6,1]},{Hue[0.8,0.4,1]}}]

5.3 Simulation

Use your results in 4.1 to simulate 1000 voltage measurements for the 4 cases above and plot histograms. Compare your histogram with those shown in the APP side by side.

Answer

kB=1.38065*10^-23 ; T=300.; B={10.^5,10.^7};R={50.,10.^6};
iNoise=Sqrt[4 kB*T*Outer[Times,B,1./R]]*10^9;
iHist=Table[Table[Histogram[RandomVariate[NormalDistribution[0.,iNoise[[j,i]]],1000]
,Frame-> True,GridLines->Automatic
,ChartStyle->Hue[(i*(j+2)-2.5)/7.,0.65,1.]
,Epilog->Inset[NumberForm[iNoise[[j,i]],{4,3}]
,Scaled[{0.2,0.8}],BaseStyle->{14,Bold}],ImageSize->200 ]
,{i,1,Length[R]}],{j,1,Length[B]}];
currentHist=Grid[Join[{{Style["Noise current (nA)",Bold],"R=50 Ω","R=1 MΩ"}}
,MapThread[Prepend,{iHist
,{"B=100 kHz","B=10 MHz"}}]]
,Frame-> All,BaseStyle->{20,FontFamily-> "Calibri"}
,Background->{{Hue[0.16,1,1],},{Hue[0.4,1,1],}}]

kB=1.38065*10^-23 ; T=300.; B={10.^5,10.^7};R={50.,10.^6};
vNoise=Sqrt[4 kB*T*Outer[Times,B,R]]*10^6;
vHist=Table[Table[Histogram[RandomVariate[NormalDistribution[0.,vNoise[[j,i]]],1000 ]
,Frame-> True,GridLines->Automatic
,ChartStyle->Hue[(i*(j+2)-2.5)/7.,0.65,1.]
,Epilog->Inset[NumberForm[vNoise[[j,i]],{4,3}]
,Scaled[{0.2,0.8}],BaseStyle->{14,Bold}],ImageSize->200]
,{i,1,Length[R]}],{j,1,Length[B]}];
voltageHist=Grid[Join[{{Style["Noise voltage (μV)",Bold],"R=50 Ω","R=1 MΩ"}}
,MapThread[Prepend,{vHist,{"B=100 kHz","B=10 MHz"}}]]
,Frame-> All,BaseStyle->{20,FontFamily-> "Calibri"}
,Background->{{Hue[0.16,1,1],},{Hue[0.4,1,1],}}]

5.4 An example with op-amp

Suppose you have the following simple amplifier (T=300 K)

Let (Subscript[R, S])= 10 kΩ, (Subscript[R, F])= 50 kΩ, What do you expect the noise level on the output for bandwidth = 1 MHz.

Answer

The noise of the output is a sum of the input noise and the thermal noise of the feedback resistor itself, (Subscript[R, F]).
Hence:     ((Subscript[σ, Vout])^2)=(((((Subscript[R, F])/(Subscript[R, s]))))^2)((Subscript[σ, S])^2)+((Subscript[σ, RF])^2)

kB=1.38065*10^-23 ; T=300.; B=10.^6;
RF=5.*10^4; RS=10.^4 ;   
σS2=4 kB T B RS ;  σF2= 4 kB T B RF  ;
Grid[{{"output noise level (μV)  =",σout=Sqrt[σS2((RF/RS))^2 +σF2]*10^6}}]