Wednesday, November 28, 2012

CS402_3_SOL

Solution

Qustion 1 
a)

b)

Question 2



reflexive, Symmetric, Transitive and anti-symmetric



Q#01:  Let X = { 1, 5, 9} , Y =  { 3, 4, 7}
            Define f : XY by  f(1) = 4,  f(5) = 7, f(9) = 4
(i)                 Is f one-one?
(ii)               Is f onto?
(iii)             Does inverse of f exist?                                                       


Q#02: Let A = {a, b, c} and R = {(a, c), (b, b), (c, a)} be a relation on A.
 Determine whether R is reflexive, Symmetric, Transitive and anti-symmetric, or not. 
                                                                                                           
Q#03: Find the 36th term of the arithmetic sequence whose 3rd term is 7 and 8th term is 17.


Please provide solution.

NFA/FA



Q. No. 1 Construct Non-Deterministic Finite Automaton (NFA) from the concatenation of the following two languages:                                         
                                                           
a. Language of all strings defined over Σ = {0, 1} whose length is even and number of 1’s are odd.

b. Language of all strings defined over Σ = {0, 1} whose second last letter is 1.

Hint: First construct FA for the given languages and then construct NFA from their concatenation.                                                                                 




Q. No. 2 Construct a Finite Automaton (FA) for the language of all strings defined over Σ = {0, 1} that ends with substring “01” and have odd length.


Reply

Aspects of Audience and Enquiry Letter



Question No.1                                                                                                           

Write an enquiry letter to the Haier Company about the new prices, margin for the dealers, new features in their split/AC before completing the final order.

Question No.2                                                                                                          
Identify five aspects of audience analysis in detail.







 Please reply

Thursday, November 22, 2012

Data Comunication




Q. 1. In data communication, you need to represent data streams (binary format) into different encoding schemes. You are required to represent the data stream 1101100111 into the following encoding schemes on different graphs separately:
1.     Return to Zero (RZ)
2.     Non Return to Zero Inverted (NRZ-I)
3.     Non Return to Zero Level (NRZ-L)
4.     Manchester
5.     Differential Manchester

Note: You are given the following template to represent the given data stream. However, you can use your own.
















Thursday, November 15, 2012

standard deviation, coefficient of skewness, distribution

Assignment No.2 (Course STA301)

 Fall2012 (Total Marks15)

Deadline

Your Assignment must be uploaded/ submitted before or on
(STUDENTS ARE STRICTLY DIRECTED TO SUBMIT THEIR ASSIGNMENT BEFORE OR BY DUE DATE. NO ASSIGNMNENT AFTER DUE DATE WILL BE ACCEPTED VIA E.MAIL).

Rules for Marking

It should be clear that your Assignment will not get any credit IF:
  • The Assignment submitted, via email, after due date.
  • The submitted Assignment is not found as MS Word document file.
  • There will be unnecessary, extra or irrelevant material.
  • The Statistical notations/symbols are not well-written i.e., without using MathType software.
  • The Assignment will be copied from handouts, internet or from any other student's file. Copied material (from handouts, any book or by any website) will be awarded ZERO MARKS. It is PLAGIARISM and an Academic Crime.
  • The medium of the course is English. Assignment in Urdu or Roman languages will not be accepted.
  • Assignment means Comprehensive yet precise accurate details about the given topic quoting different sources (books/articles/websites etc.). Do not rely only on handouts. You can take data/information from different authentic sources (like books, magazines, website etc) BUT express/organize all the collected material in YOUR OWN WORDS. Only then you will get good marks.

Objective(s) of this Assignment:

  • The assignment is being uploaded to build up the concepts about the measure of dispersion.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
  •  How to compute regression line.
  • Application of moment ratio.
Assignment # 2 (Lessons 10-15)
Question 1:                                                                                                                        (Marks: 3+5=8)
a)      The fourth mean moment of a symmetric distribution is 243. What would be the value of the standard deviation in order that the distribution may be meso-kurtic?
b)      Two candidates X and Y at the B.A (Hons.) Examination obtained the following data.
Candidate X
Candidate Y
= 43.2
= 20.5
S.D = 24.25
S.D = 15.6

Which of the candidate showed a more consistent performance?
Question 2:                                                                                                             (Marks: 2+5=7)
  1. If coefficient of skewness = 0, then what would you say about the shape of the distribution?
  2. The following data were computed from personnel records of a manufacturing firm:
             X = Number of years of service
            Y = weekly wage rate
 If the correlation coefficient indicates that there does exist a relationship between X and Y, compute the least squares line of regression Y = a + b X. 

Wednesday, November 14, 2012

electricity for domestic and commercial usage




Problem Statement:     Pakistan Electric Supply Company (PESCO) supplies electricity for domestic and commercial usage all over Pakistan.
You are required to write a program for calculating the amount of bill paid by the customer for both domestic and commercial usage. User will enter customer number and amount of units consumed, and the program will calculate the amount of bill accordingly.



  • The program should take customer type as input which must be ‘1’ or ‘2’and the number of units consumed.
  • If the user enters ‘1’ then he/she is a domestic user.
  • If the user enters ‘2’ then he/she is a commercial user.
  • If user enters any other number except 1 or 2, the program should terminate after displaying a message “Invalid choice”.
  • After taking valid customer type from user, program should ask user to enter the customer number, number of consumed units and number of days.
  • For domestic customer, if the units consumed are between 0 and 100, the price is Rs.5 per unit and there will be no extra charges.
  • If the units consumed are between 101 and 300, the price is
Rs.8 per unit plus Rs.100 as extra charges.
  • If the units consumed are between 301 and 500, the price is
Rs.10 per unit plus Rs.230 as extra charges.
  • For commercial customers, the price is Rs.15 per unit, which is uniform for any number of units.
  • If user deposits bill within 10 days, he/she will not be incurred for any extra charges.
  • If user deposits bill after 10 days, he/she will be charges for Rs. 200 as extra charges.
  • You are required to write 2 functions. One for calculating the bill for domestic customer, and 2nd to calculate the bill for commercial customer.
  • Use switch structure to determine the customer type. Then pass the customer number, consumed units and number of days to the corresponding function as arguments.
  • These functions will calculate and return the total bill for the customer.


The sample output is attached with this assignment named Assignment2.gif.




Google Analytic