1 Introduction to coding and information technology Digital communication is the field of engineering science that deals with the transportation of an information bringing signal from source to destination via a communication channel while this information is presented in a digital form. The basic objective of digital communication engineering is to satisfy the channel limitations while maximizing the amount of information that can be transmitted. 1.1. Basie Signal Processing In Digital Communication Systems Most of the information sources produce such information in analog form. For example, human voice, television picture, temperature, and weight are information in analog form. There are some information are digital by nature such as text, count of people and status of a lamp (on or off). An analog signal can be converted to digital form using three basic operations: Sampling, quantization and encoding, as shown in figure (1-1). Analog | Digital seb! Sampling p> Quantization Encoding -— signal signal Figure 1-1 Analog to digital conversion Dr. Ahmed EL Dessouks 2 In sampling process, only values of the signal in predefined uniformly spaced discrete instants of time are considered. The process is shown in figure (1- a 2)-a. In quantization, the value of the sampled signal is approximated to the nearest level in a finite set of discrete levels as shown in figure (1-2)-b. Finally, the selected level is presented by a code word as shown in figure (1-2)-c. t Sp SS Wrsst 8 (n-2)T (a-l)T ——<- Vai ae Time orn | | ae eee (a) 4 So £ = f4—_E=t han #S8222 || aay ae eres: 2 | bps x — | Time Piias ope 11/0000] 1100/1 0 rire) (c) Figure 1-2 Process of analog to digital conversion (a) sampling (b) quantization and (c) encoding The basic process in any digital communication system consists of three yeep gimmitaenne het processing operations for transmission, source encoding, | channel encoding and ee modulation and three paneer operations for reception, detection, channel ——— 3 Introduction to coding and information technology 9 decoding, and source decoding. Figure (1-3) shows the block diagram of the digital communication system, ° Transmitter —— an ee eee, rpoocrcrrrcr-r---- a | ) | Discrete Channel Digital Source Ch | amnel source encoder stedee jo Modulator : | y | , | | User |e} Source Channel | , _|} decoder decoder |] Depeche le | mo | | ‘ tk nt Receiver Pa ee ee ee Figure 1-3 Block diagram of digital communication system The he digital source in source in figure (1-3) is the one discussed i in figure (1-1). The _ source encoder maps the di maps the digital signal into. another digital form that reduces the redundancy and provides an efficient presentation of the source output. The source eaeemenae eel decoder i in the receiver retrieves the original digital signal. The channel’ encoder and decoder are used to minimize the effect of the 2 ; channel noise into the signal. The channel” encoder put the digital output of the source encoder in a predefined waveform. The difference between the source ; _ encoder and the channel « encoder is the difference between the digit 1 and the gnal wave form that i is used | to to represent that digit. Figure (1-4) shows different presentation of two digits (0 and 1). Both source encoder and channel encoder 4 4 oe 2013 Tose sh = ae 4 10 0 ee ik 0 volte -5 volte Tl +45 volte 1 = L. O volte (a) (b) Figure 1-4 Two digits presentation (a) unipolar (b) bipolar Modulation is the process that injects the signal into a carrier by modifying its amplitude, frequency or phase. For. digital communication systems, such process is called Amplitude Shift Keying (ASK), Frequency Shift Keying (FSK) or Phase Shift Keying (PSK) respectively. The basic objective of modulation is charring the channel with multi-users without interfering each other and matches the requirement of data transmission to the properties of the channel according to the frequency range. 5 Introduction to coding and information technology 11 \ 1.2. Problems 1-Draw the basic diagram of Analog to digital conversion and explain by figure _ * _. the conversion process. __ 2-Draw the block diagram of digital communication system. - 3- State the difference between source encoding and channel encoding. 2013 Dr. Ahmed EL Dessouky 6 Introduction to coding and information technology 13 Dr. Ahmed EL Dessouky PROBABILITY (REVIEW) 2 2013 7 14 2.1. Introduction Probability is relatively familiar well known term. However, when looking up the definition of probability, a variety of similar definitions will be found. Probability is all around us. Probability refers to the likelihood or relative frequency for something to happen. The range of probability falls anywhere between impossible and certain. When speaking of chance or the odds; the chances or odds of winning the lottery, we're also referring to probability. The chances or odds or probability of winning the lottery is something like 18 million to 1. In other words, the probability of winning the lottery is highly unlikely. Weather forecasters use probability to inform us of the likelihood (probability) of storms, sun, precipitation, temperature and along with all weather patterns and trends. You'll hear that there's a 10% chance of rain. To make this prediction, a lot of data is taken into account and then analyzed. The medical. field informs us of the likelihood of developing high blood pressure, heart-disease, diabetes, the odds of ~ beating cancer etc. In summary, probability deals with patterns and trends that occur in random events. Probability -helps ‘us to determine ‘what the likelihood of something happening will be. Statistics-and simulations help us to determine probability with Psi cemTetse one.could’say probability is the'study: of chance. It affects’so many aspects in life, everything from earthquakes occurring to sharing a ofa, If you're interested in probability, the field in math you'll want to pursue ~ _ will be data management and statistics. In a single statement “Probability is a branch of mathematics that deals with calculating the likelihood of a given evént's occurrence, which is expressed as a number between 1 and 0.” 8 Introduction to coding and information technology 15 2. 2. Probability Definition Assume an event A in a sample space S (A is subset of S). There is associated number P(A) called probability of A is given by: Number of points in A P(A)= , = Number of points in S (2-1) nr nn such that 1- 0< P(A)<1 2- P(S)=1 Hence the probability of an event is the relative frequency of such event which is given by: f me A (4) _ Number of times A occurs Gea Number of trials (2-2) = 2:3. Mutual Exclusive Events Jn __In probability theory, events El, E2, ..., En are said to be mutually exclusive poe if the occurrence of any one of them automatically implies the non-occurrence of ~~~ the reinsiting, n—1 events. Therefore, two mutually exclusive events cannot both 3 “© occur. « a em) For such. events s the relation: | naieeetiee ereabinns oe oe AN B= ice (2-3) “holds, where A and B are events is the sampling space S, [) represents the intersection relation and ® is the empty set. Tossing of a coin represents an example of mutually exclusive events. The two events in this case is outcome of tossing a coin (head or tail). None of the two events can take place in the presence of the other. Hence, equation (2-3) holds for such events. 2013 Dr. Ahmed EL Dessouky 9 16 The events of rolling a dice, election outcome, and being in two different - places are examples of mutually exclusive events. —_—__—_ * 2.4. Basic Theorems for probability 2.4.1. Complement Rule The complement of an event A is the set of all outcomes in the sample space that are not included in the outcomes of event A. The complement of event A is represented by A (read as A bar). Given the probability of an event, the probability of its complement can be found by subtracting the given probability from 1. P(A) =1— P(A) (2-4) Proof: Figure 2-1, Set relations for A and A Figure (2-1) shows. the set relation for set A and 4. From the figure the ‘following can be stated. S=AUA —_— (2-5) 10 Introduction to coding and information technology 17 Events A and A are mutually exclusive (A and A cannot take place at the same time), hence: R(S)=1= P(A)+ P(A) (2-6) “. P(A) =1- P(A) Example [ 2-1]: Assume a student probability to pass the coding exam is 0.8. What is the probability of failing to pass the-coding exam? Passing .and failing, into the same exam are mutually exclusive events. Failing to pass the exam is the complement of ‘passing the exam. Hence equation (2-5) holds true-and the probability to fail to pass:the exam is 0.2. 2.4.2. Addition of Mutually Exclusive Events The addition of mutually exclusive events is the’possibility that one or more _of those events would take place. In analytic form: P(A UA,U--UA,) = P(A) + P(A) #+P(4,) (2-7) Example [.2-2]: The probabilities of a student to get scores A, B, C, D and F are.0.05, 0.15, 0.2, 0.3and 0.3 respectively. What is the probability of-a student to pass the exam? To pass’ the: exam, a student.should get score'A, B, C or D. The events are mutually exclusive (A ‘student cannot. get two scores.at the same exam). Hence, applying equation (2-8) we get: P(AUBUC.UD) = P(A) + P(B) + P(C) + P(D) P(AUBUCUD) = 0.05+0.15 + 0.2+0:3=0.7 Of course it can be calcatated using the complement rule as follow P( pass) = P(F) =1— P(F)=1-0.3=0.7 Example [ 2-3]:_ Dr. Ahmed EL Dessouky 2013 11 18 Flipping two fair coins. (This is an experiment.) The sample space is {HH, HT, TH, TT} where 7 = tails and H = heads. The outcomes are HH, HT, TH, and TT. The outcomes HT and TH are different. The HT means that the first coin showed heads and the second coin showed tails. The TH means that the first coin showed tails and the second coin showed heads. Let A = the event of getting at most one tail. (At most one tail means 0 or | tail.) Then A can be written as {HH, HT, TH}. The outcome HH shows 0 tails. HT and TH each show | tail. Let B = the event of getting all tails. B can be written as {TT}. B is the complement of A. So, B = A'. Also, P(A) + P(B) = P(A) + P(A!) = 1. The probabilities for A and for B are: P(A)= =, P(B)= =. Let C = the event of getting all heads. C = {HH}. Since B = {TT}, P(B AND C) = 0. B and C are: mutually exclusive. (B and C have no members in common because you cannot have all tails and all heads at the same time.) Let D = event of getting more than one tail. D={TT}. e = 1 “. P(D) r Let E = event of getting a head on the first roll. (This implies you can get _ either a head or tail on the second roll.) E={HT;HH}. -. P(B)= : Find the probability of getting at least one (1 or 2) tail in two flips. Let F = event of getting at least one tail in two flips. F={HT,TH,TT}. _ 3 P@=4 12 Introduction to coding and information technology 19 2.4.3. Addition of Arbitrary Events oo ee ee ; For events A and B in the sampling space S ee P(AUB) = P(A)+ P(B)— P(ANB) (2-8) Proof: Assume the set relation shown in figure (2-2) for two independent arbitrary events A and B. P(A) = P(C)+ P(D) (2-9) P(B)= P(E)+ P(D) (2-10) -. P(AUB) = P(C)+ P(D) + P(E) (2-11) ”. P(AUB) = P(A) + P(B)- P(D) -* P(D) = P(AN B) » P(AU B) = P(A)+ P(B)— P(A()B) If A and B are mutually exclusive events, - P(ANB)=® ‘Hence P(AUB)=P(A)+ PCB) which complies with equation (2-8). *hmed EL Dessot 13 20 Figure 2-2 Set relation of two arbitrary events 2.4.4, Conditional Probability for dependent events” rn For events A and Bi in: the ; sampling space S © PANS) “P(A,B) P(A|B)= PCy PB) | the same time. ae Di as | eaten mnceacer ~ means ns the probability: of. an. event. aes take ple in’ sondition’? that A is ‘cca | present (PAH=h-— ass eae eects | Accordingly: oe eautaees | | P(ANB)= P(A, B)_ PBL A A= = PB)PCA l B) (2-14) Yoneda canara raaaane ne e Example [2-4]: _ Assume a production line of radio sets produces 10% defective sets. 20% of defected sets have defected speakers. What is the Probability that a produced radio set has defective speakers? 14 Introduction to coding and information technology 21 Probability of defective sets= P(A) =0.1. Probability of defective sets that have defective speakers = P(B| A) = 0.2. The probability that the production line produces defective set with defective speakers is given by: P(A(\B) = P(A)P(B| A) =0.1x0.2 = 0.02 2.4.5. Conditional probability for independent events For events A and B in the sampling space S, if events A and B are independent events then: P(A,B)= P(A()B) = P(A)P(B) (2-15) “. P(A| B) = P(A) (2-16) and P(B| A)= P(B) (2-17) Example [ 2-5]: For the problem given in example [2-4], assume 20% of defected sets have defected speakers while 10% of the defected sets have defected antenna. What is the probability that a defective radio set has defective speakers and antenna? What — is the probability that:the produced radio set is-defectéd: with defected speakers and antenna. Let A represent the defective radio sets. Hence probability of:defective sets: P(A) =0.1 Let B represent the radio sets with defective ‘speakers. Then, probability: of defective sets that have defective speakers: P(B| A)=0.2. Let C represent the radio sets with defective antenna; hence, Probability of defective sets that have defective antenna: P(C | A) =0.1. Hence Dr. Ahmed EL Dessouky 2013 15 22 .. The probability that a defective radio set has defective speakers and antenna is given by: ; P(B(\C| A) = P(B| A)P(C| A) =0.2x 0.1= 0.02 The probability that the produced radio set is defected with defected speakers and antenna is given by: P(BI\C)= P(BM\C| A)P(A) = 0.02 0.1= 0.002 Example, [ 2-6]: Assume a student probability to pass coding exam is 0.7 while his probability to pass microprocessor exam is 0.8. What is his probability to pass both exams? i ‘: Both exams are independent, .’. if the probability to pass. the coding exam is P(A) and the probability to pass microprocessor exam is P(B), then the probability to pass both exams is given by: P(A,B) = P(A) P(B) = 0.70.8 = 0.56 Example [ 2-7]: | A.box of 10 screws has-three out of the,10 screws defected. Two screws are drawn at random. Find the pro ability_that.none-of the'two screws are defected. A:1 screwiis sion-defected; hence .P(.A) =7/10 B: 2" screw is non-defected after the 1° non-defective screw is drawn, hence' P(B| A) = 6/9. Using equation (2-13) we get: -. P(A, B)=P(AN)B) 2.5. Random Vari bability distributions A random variable x is a function associated with an experiment whose values are real number and their occurrence in the trials depends on chance. 16 Introduction to coding and information technology 23 2.5.6. Discrete Random variable and Distributions A random variable x and its distribution are called discrete if x can assume only finite values say X1,X,°°°,X,, with positive probabilities P,,P2.°**>Pm respectively. en JPA PPK 7 =1,2,--+,m (2-18) “£O) { Cire —_ The distribution function F(x) is given by: F(x)= > f(x) =D Pp; (2-19) xjSx xjSx _ ean xample [ 2-8]: Draw the probability and probability distribution function of the outcome of rolling a fair dice. The dice has 6 faces. The outcome of rolling a dice is a discrete event with equi-probable outcome. Hence the probability of each face is 1/6. Figure (2-3) shows the probability and probability distribution function of rolling a fair dice. Example [ 2-9]: Draw the probability and probability distribution function of the sum of rolling two fair dices outcome. The two dices are independent; hence the probability of having a sum of 2 is given by equation (2-15). As it is known from the previous example, the probability of each face of a single dice is 1/6. Hence > P(2) = P(1,1) == P(1)P(1) = 1/6x1/6 = 1/36 P(3) = P(2,1) + P(1,2) = P(2)P(1) + P(1)P(2) = 1/6x1/6+1/6x 1/6 = 2/36 Dr. Ahmed EL Dessouky am 17 24 o co U o co 1 9 ~ La eH NO Figure 2-3 Probability and probability distribution function for rolling a fair dice. an A ai IRE P(4) = P(3,1) + P(2,2) + P(1,3) = P(3)P(1) + P(2)P(2)+ P(1)P(3) =.3/36 and.so on Hence the probability and probability distribution function of rolling two fair dices is as shown in figure (2-4). 18 Introduction to coding and information technology 25 ICD 0.15 + Figure 2-4 Probability and probability distribution function for rolling two fair dices. 2.6. Probability Corresponding to Intervals The probability of an interval is given by: - ae Pia<xs< b) 5 F (d) — F(a) ( 2-20) Example [ 2-10]: For example (2-9), compute the probability of a sum of the two dices outcome be at least 4 and at most 8. Applying equation (2-20) we get: Dr. Ahmed EL Dessouky 2013 19 26 3<x<8)=F(8)—-F(3)=—-—= P( )=F@)-FO)= 70-36 = 36 2.7. Continuous Random Variables and Distribution A random variable x and its distribution are called continueus-#£.x can PO ra ee ee ee : asgumesininits values. 20 this cass, probability of a significant value is zero. It is more fishable to measure the probability corresponding to intervals. Assume a random variable x of a probability defined by the function F(x), then. F(x)= | f(v)dv (2-21) and | F(v)dv=1 ( 2-22) , 4 P(a<x<b)=F(b)-F(a)=| f(v)dv (2-23) Ex A random variable x with probability function given by: f(x)=0.75(1-x”) -1<x<1. Find F(x), P(-1/2<x<1/2) and P(=1/4Sx<2)_ Solution: Vv F(x)= [ #O)dy = [o.750-v?)dv = 019 — - | 00 -l | F(x) = 0.5+0.75x—0.25x° 20 Introduction to coding and information technology 27 P(-1/2<x<1/2) = F(1/2)—-F(-1/2) = 0.5+0.75x 0.5—0.25(0.5)° ~0.5—0.75x 0.5 + 0.25(—0.5)° = 0.6875 The function (x) =0.75(1—x”) is defined on the interval -1<x<1 only and hence P(1/4 < x <2) = P(1/4<x <1) then P(i/4<x<1)=F()-F(/4) = 0.5+0.75x1—0.25(1)° ~0.5—0.75(0.25) + 0.25(0.25)° = 0.31640625 2.8. Mean and Variance The mean yz is defined by: H = 2x) F(%;) J ( 2-24) —_— M= | xf (x)dx (2-25) _— 8 Po for continuous distribution. The discrete distribution is said to by symmetric with respect to number x=c if f(e+x)= f(c—x) ( 2-26) Hence, if it is symmetric and have mean= // then L/=c. The variance o” is given by Dr. Ahmed EL Dessouky 2013