Ads

Pages

Saturday, October 29, 2011

CS401 Assignment No. 1 Fall 2011 solution


Question No. 1:

a)

Suppose your computer has a processor with 24-bit address lines. What is maximum amount of memory that can be attached in your system? (Show the step(s) for calculation of maximum addressable memory) (2.5 marks)

Solution: -

Accessible memory addresses = 2number of address bits

224 = 16777216 bytes

16777216 / 1024 = 16384 KB

16384 / 1024 = 16 MB

b)

How many address bits are required for accessing 1GB RAM? (Show the step(s) for calculation of required address bits) (2.5 marks)

Solution: -

As you know 1GB means 1024MB so we can write it as

1GB = 1024 x 1MB

As you know that 1MB is 220

So we can write the expression as

1024 x 220

This can be further simplified as

210 x 220

=230

Hence, 30 address lines are required to access 1GB RAM.

Question No. 2:

What are the contents of memory locations 0151, 0152, 0153, ………….,0158 if 0151 is starting address for Label1. (1 mark for each location)

Label1: dw 8494

db 42

dw 54

dw 7500

db 01

Solution: -

Memory location Contents

0151 94

0152 84

0153 42

0154 54

0155 00

0156 00

0157 75

0158 01

Question No. 3:

a)

Calculate physical address using the following segment offset pairs. (1 mark each)

1. 00EA:02A4

2. 0100:AA23

3. D3B8:F222

4. 00A0:1234

5. 8FEf:0FFF

Solution: -

Memory Location

Contents

0151

94

0152

84

0153

42

0154

54

0155

00

0156

00

0157

75

0158

01

Question No. 3:

a)

Calculate physical address using the following segment offset pairs. (1 mark each)

1. 00EA:02A4

2. 0100:AA23

3. D3B8:F222

4. 00A0:1234

5. 8FEf:0FFF

Solution: -

1)

00EA0

002A4 +

_______

01144 = physical address

2)

01000

0AA23 +

_______

0BA23 = physical address

3)

D3B80

0F222 +

______

E2DA2 = physical address

4)

00A00

01234 +

________

01C34 = physical address

5)

8FEF0

00FFF +

_________

90EEF = physical address

b)

What is effective address generated by the following instructions? Every instruction is independent of others. vusolutions Initially bx = 0x0101, bp=0x0222, si=0x1234, var1=0x1771 (1 mark each)

1. mov ax, [bx+si]

2. mov ax, [bx+100] (100 is in decimal)

3. mov ax, [bp+si]

4. mov ax, [var1+bp]

5. mov ax, [si+var1]

Solution: -

1)

Effectice address = [bx+si]

= [0101 + 1234]

= [1335]

2)

Effectice address = [bx + 100]

After converting 100 into hexadecimal

Effectice address = [bx + 64]

= [0101 + 64]

= [0165]

3)

Effective address = [bp+si]

= [0222 + 1234]

= [1456]

4)

Effective address = [var1+bp]

= [1771 + 0222]

= [1993]

5)

Effective address = [si + var1]

= [1234 +

CS402 Assignment No. 1 Fall 2011 solution


Theory of Automata

CS402

ASSIGNMENT NO.1

Total Marks= 20 (4+4+4+4+4)

Assignment Submission Deadline

Your assignment must be uploaded before or on 31-10-2011 [upload your assignment well before due date to avoid any assignment uploading related issues]

Rules for Marking

It should be clear that your assignment will not get any credit if:

o The assignment is submitted after due date

o The assignment is copied

Objectives

Objectives of this assignment are to make students able to understand the following concepts,

o Basic concepts clarification

o Recursive Definition of a language

o Regular Expression

o Finite Automata

Question No.1 Basic Concepts [Sets, Letters, Valid Alphabet, Languages, Strings and Words]

a. Which of the following are strings generated from alphabet Σ = {a, b}

i. abba

ii. baa$a

iii. abc.

iv. ba?

v. b.bba

b. Which of the following are valid words for language of all strings ending with bab defined for alphabet Σ = {a, c , bab}

i. acccba

ii. cccbaa

iii. cccbab

iv. babbb

v. baaab

Question No.2 Defining Languages [Using Recursive Definition, Re’s, Fa’s]

Give recursive definitions of following languages defined over alphabet Σ = {a, b}

i. Having all strings starting with b and having length greater than 2

ii. NOT having ab at any place.

Question No.3 Regular Expressions

Give Regular Expression for each of the following language defined over alphabet Σ = {a, b}

i. Even Length strings ending with b

ii. Strings with b’s count multiple of three

Question No.4 Models To Recognize Languages (Fa’s)

Give Finite Automata (FA) for each of the following language defined over alphabet Σ = {a, b}

i. Language having all strings NOT containing aa at any place

ii. Language of all strings NOT STARTING with bb

Question No.5 Models To Recognize Languages (Nfa’s)

Give Non Deterministic Finite Automata (NFA) for each of the following language defined over alphabet Σ = {a, b}

i. Language of all strings STARTING WITH bba

ii. Language having all strings NOT having even no of a’s and b’s

You can view the demo video in file,http://vulms.vu.edu.pk/Courses/CS402/Downloads/Assignment1.00.zipto see how to make FA in MS Word.

Note:

Please keep in view the following points while attempting any question:

• Where OR is used in the description of a language it means that expressions on both sides of ‘OR’ are parts of the language.

• Where NOT is used in the description of the language it means that language includes all strings except described in the ‘NOT’ condition, for example

language NOT starting with a, means all strings not having a in the start (you have to evaluate yourself what kinds of strings are these).

Assignment Uploading Instructions:

o Upload single word file having solutions for all parts as well as chart images.

o You can crop and compress images in the word file by double clicking on an image and selecting compress all images option to decrease file size before

uploading it.

Appendix:

Definition of Set:

A set can be defined as follows:

“Non repeating collection of elements”

Example Sets:

i. {car, bus }

ii. {table, chair , stand}

iii. {basket ,eggs}

iv. { ^, #, *, / }

However {car, car, bus} is NOT a set according to its definition.

Solution:


Question No.1 Basic Concepts [Sets, Letters, Valid Alphabet, Languages, Strings and Words]
a. Which of the following are strings generated from alphabet Σ = {a, b}
i. abba
ii. baa$a
iii. abc.
iv. ba?
v. b.bba

b. Which of the following are valid words for language of all strings ending with bab defined for alphabet Σ = {a, c , bab}
i. acccba
ii. cccbaa
iii. cccbab
iv. babbb
v. baaab


Question No.2 Defining Languages [Using Recursive Definition, Re’s, Fa’s]
Give recursive definitions of following languages defined over alphabet Σ = {a, b}

i. Having all strings starting with b and having length greater than 2

Answer. { baa, bab, bba, bbb, bba, baab, ….. .. }

ii. NOT having ab at any place.


Answer. {^, a, b, ba, bab, bba, bbb, baa, bbba,…..}

Question No.3 Regular Expressions
Give Regular Expression for each of the following language defined over alphabet Σ = {a, b}

i. Even Length strings ending with b

Answer. { ^ ,ab, bb, aabb,abab, bbbb, aaaabb, aaabab, ……}

ii. Strings with b’s count multiple of three

Answer. {^, bbb, bbbbbb, bbbbbbbbb, bbbbbbbbbbbb, bbbbbbbbbbbbbbb,
bbbbbbbbbbbbbbbbbb, bbbbbbbbbbbbbbbbbbbbb,………}


Question No.4 Models To Recognize Languages (Fa’s)
Give Finite Automata (FA) for each of the following language defined over alphabet Σ = {a, b}

i. Language having all strings NOT containing aa at any place

Answer. { ^, a, b, ab, ba, abb, bab,bba, baba, abbb, ….}

ii. Language of all strings NOT STARTING with bb

Answer. { ^, a, b, aab, aaab, abab, aabab, …….}

Question No.5 Models To Recognize Languages (Nfa’s)
Give Non Deterministic Finite Automata (NFA) for each of the following language defined over alphabet Σ = {a, b}

i. Language of all strings STARTING WITH bba

Answer. { ^, bba, bbaa, bbaba, bbaab, bbab, bbabb, …}

ii. Language having all strings NOT having even no of a’s and b’s

Answer. {^, a, b, aaab, bbba, ababab, aaaaab, bbbbba, ……}

Friday, October 28, 2011

CS201 Assignment No. 1 Fall 2011 solution

Assignment No. 01

Semester: Fall 2011

CS201: Introduction to Programming Total Marks: 20

Due Date:02/11/2011

Problem Statement: Virtual Restaurant

You are required to write a program for BILLING SYSTEM of a virtual restaurant. The basic idea is that by entering the meal price, your billing system will calculate the Sales Tax, Total amount and Complement offer upon that meal. The program will process the billing of undetermined number for customers. At the end, program will show sum of total amount of all the customers.

Detailed Description:

Billing System should work as under:

> You are required to take meal price as input from user.

> After getting this input, program will calculate the sales tax on it as given below:

Meal Price Sales Tax applicable

Less than or equal to 1000 No sales Tax on it.

Greater than 1000 and less than or equal to 2000 1% of meal price.

Greater than 2000 2% of meal price.

> After calculating the sales tax, program will calculate and display the total amount of the meal according to given formula:

Total Amount = Meal_Price + Sales_Tax

> Now, program will prompt to serve the complement sweet dish to customer on the basis of total amount as given below:

Total Amount Sweet Dishes

Less than 1000 Candies

Greater than or equal to 1000 and less than 2000 Sweet Bread

Greater than or equal to 2000 and less than 3000 Pudding

Greater than or equal to 3000 and less than 4000 Cake

Other amounts Trifle

> After displaying the information of one customer, the program should ask the user if he/she again wants to process the bill of another customer. The user will be given two options. If user selects "Y or y", the program will start the processing of another customer. If user selects "N or n", the billing system exits.

> Before exiting from billing system, this program should display the total number of customers it processed, and sum of total amount of all the customers.

:::::::

You are required to write a program for BILLING SYSTEM of a virtual restaurant. The basic idea is that by entering the meal price, your billing system will calculate the Sales Tax, Total amount and Complement offer upon that meal.

#include

#include

int main()

{

int price;

cout << "Please enter meal price? ";

cin >> price;

float saleTax;

if(price<=100)

{

saleTax = 0.0 * price;

}

else if(price <= 200)

{

saleTax = 0.1 * price;

}

else

{

saleTax = 0.2 * price;

}

int totalAmount;

totalAmount = price + saleTax;

cout << "The total price of Meal is = " << totalAmount << endl;

getch();

}

Mgt411 Assignment No. 1 Fall 2011 solution


Semester “Fall 2010”

“Money & Banking (MGT411)”

Assignment No. 01 Marks: 20

Mr. Naeem is working as a finance manager at Superior Textile Mills Limited, after completing his MBA (Finance) from Virtual University of Pakistan.

Recently, he got married and shifted his family in a rented house near the office. Paying monthly rent is a painful experience and in this way he cannot save much for his future needs. Therefore, he is planning to purchase his own house for avoiding monthly rental expense. For this purpose he is expecting to sell share in his native house for Rs. 1,500,000/- which is not a sufficient amount to buy house in a big city. After considering various areas in Faisalabad city, he chose Model Town for his desired future residency. Based on the house prices data in that area, he learned that an average two bed room house currently costs Rs.2,400,000/-. So he has to set aside some funds for the next eight years so that he may be able to purchase his own house after having sufficient funds.

As Mr. Naeem is planning to purchase the house after eight years, so it is quite clear that the prices of the houses will not remain the same overtime. In order to estimate the rate at which the house price will increase he considered the historical price appreciation data in that area and resulted that house prices appreciated at the rate of 4% per annum.

Mr. Naeem is planning to invest the funds that will be devoted for purchasing the house, in a portfolio of investment. He feels that this investment portfolio containing stocks, bonds and govt. securities will give him the rate of return of 9% p.a.


SOLUTION


Please confirm this solution before submitting


Q#1: Considering the fact that the vu39.com house prices will grow at the rate of 4% per annum, what will be the future house price of the house Mr. Naeem intends to buy after 8 years


FV = PV (1+i )n
FV = 1,500,000 (1+0.04)8
FV = 1,500,000 (1.04)8
FV = 1,500,000 (1.3685)
FV = Rs. 2,052,853/-


Q#2: Based on the answer from Q#1(FV), how much amount Mr. Naeem should invest today (which earns 9% rate of return) so that he may be able to purchase his house after 8 years.


2,052,853 = PV (1+0.09)8
2,052,853 = PV (1.09)8
2,052,853 = PV (1.9925)
PV = 2,052,853 / 1.9925
PV = Rs. 1,030,290/-


Q#3: Assume the vusolutions house prices appreciate at the rate of 6% per annum instead of 4% then how much he should invest today in order to be able to purchase the house after 8 years.


FV = 1,500,000 (1.06)8
FV = 1,500,000 (1.5938)
FV = Rs. 2,390,772/-
2,390,772 = PV (1.09)8
2,390,772 = PV (1.9925)
PV = 2,390,772 / 1.9925
PV = Rs. 1,199,885/-


Q#4: If Mr. Naeem decides to deposit in less risky certificate of deposits earning vusolutions only 5% p.a. then how much funds he has to deposit in his bank to be able to purchase the house after 8 years.


2,052,853 = PV (1.05)8
2,052,853 = PV (1.4775)
PV = 2,052,853 / 1.4775
PV = Rs. 1,389,409/-


Q#5: If Mr. Naeem decides to invest in more risky growth stocks earning 12% rate of return then how much funds he has to invest to purchase his house after eight years.


2,052,853 = PV (1.12)8
2,052,853 = PV (2.4759)
PV = 2,052,853 / 2.4759
PV = Rs. 829,137/-

CS507 Assignment No. 1 Fall 2011 Solution


Assignment No. 01

SEMESTER Fall 2011

CS507- Information Systems

Total Marks: 10

Due Date: 31/10/2011

Q#1: A Shoe manufacturing company wants to transfer its manual working system into computerized based information system. Suppose you are in the design team who is developing a technology based information system.

What factors would you consider while developing a new system? Mention at least five factors. [5 marks]

Q#2: Given diagram belongs to a certain system. Identify that the diagram belongs to closed loop system or open loop system? Give three valid reasons to support your answer. [ 2+3 marks]


Solution:



Solution Q 1.

Information Systems


In modern age, there has been felt a growing need for the use of information being in the design team I will consider the following five important factors:

· Transforming Industrial Economies

· Transformed Business Enterprise

· Emerging Digital Firms

· Emerging Global Economies

· Effective and efficient utilization of resources


Emerging Global Economies
High level of foreign trade has resulted in imports and exports which require inter linkage for smooth coordination. Core business functions (manufacturing, finance and customer support) have been distributed in different countries.


Coordination
Transforming Industrial Economies
Industrial economies have started merging as knowledge-and-information-based economies. Manufacturing activities being shifted to low wage countries. More opportunities are available in education, health care, banks, insurance firms and law firms. More knowledge and information intense products are being created. Higher commitment expected from customer e.g. overnight package delivery, worldwide reservation systems.


Transformed Business Enterprise
The structure of business enterprise have also changed, initially the organizations used to be Hierarchical, Centralized, Structured following a Fixed Set of SOP’s. However, now the organizations are moving towards more Flatter, Decentralized and Flexible structures. Information Technology makes it convenient and efficient to promote this new culture.


Emerging Digital Firms
Firms where all significant business process and relationships with customers and suppliers and employees are digitally enabled and key corporate assets are managed through digital firms. This results in rapid response with more flexibility to survive and getting more global.


Effective and efficient utilization of resources
Effectiveness and efficient usage of resources has become a dire need of today’s organization and it cannot be ignored


Solution Q 2.
This system is a closed system because

· Input is manipulated in a controlled mechanism

· It is not connected with the environment

· Neither environment exerts any influence on the system nor does system influence the environment

Mgt613 Assignment No. 1 Fall 2011 solution


Semester “Fall 2011”

“Production and operations management” (MGT613)

Assignment No. 1 Marks: 20

FIFCO is a football manufacturing company in Sialkot, it has started its operations from January 2000 and since then the company is unable to gain ample profits and grab the expected market share. The major mismanagement noticed is especially in the area of inventory management. Due to this finished stocks are piling up in the warehouses. The situation is very drastic and company is unable to handle its stock. It seems that the company is facing problems in their forecasting, as the company is unable to assess and meet the actual market response that might affect the demand and fulfillment of customer’s orders. After analyzing the situational factors it seems that the company is unable to forecast demand effectively. The actual and forecasted demand of the past five years is given as under:

Years

2005

2006

2007

2008

2009

Actual demand (Units)

4000

3700

4000

4150

4050

Demand Forecasted (Units)

4500

4000

3500

3500

4200

The situation is very alarming for management and you as an operation manager of the company are required to examine and analyze all scenarios and give your recommendations that:

What would be the core areas you have to cover in order to have a most accurate forecast for the company?

What are the steps you would like to follow in the design of a most effective forecasting process? Give your suggestions after analyzing the variances in given table.

Important Tips

This Assignment can be best attempted from the knowledge acquired after watching video lecture no. 01 to lecture no. 09 and reading handouts as well as recommended text book).

Schedule

Oct 21st, 2011

Oct 28th, 2011

Note:

Only in the case of Assignment, 24 Hrs extra / grace period after the above mentioned due date is usually available to overcome uploading difficulties which may be faced by the students on last date. This extra time should only be used to meet the emergencies and above mentioned due dates should always be treated as final to avoid any inconvenience.



Solution:

Q. 1 answer is in lecture No. 9, and Q. 2's answer is on page 45. Kindly take the data from the said locations.



Question N0.1: What would be the core areas you have to cover in order to have a most accurate forecast for the company?

Answer:-
Forecasting is a natural extension to the types of data analysis typically performed on the historical data stored in analytic workspaces. Using Analytic Workspace Manager, you can quickly generate forecasts of your measures.


Here I discuses Some core areas for accurate forecast related to inventory management because in the above scenario the major mismanagement noticed is especially in the area of inventory management.


Counting current stock:-
All business must know what they have on hand and evaluate sock levels with respect to current and fore-casted demands. Company managers must know what they have in stock to ensure that they can meet the demands of the customers and production and be sure that you are ordering enough stock in the future. Counting is also important because it is the only way you will know if there is a problem with theft occurring at some point in the supply chain of inventory.


Cyclical counting:-

Companies prefer to count inventory on a cyclical basis to avoid the need for shutting down operation while stock is counted. This means that a particular section of the warehouse or plant is counted at particular times, rather than counting all inventory at once. In this way, the company takes physical count of inventory, But never counts the entire inventory at once.


Controlling supply and demand:-
Whenever possible, obtain a commitment from a customer for a purchase. In this way, you ensure that the items your order will not take space in your inventory for long. When this is not possible, you may be able to share responsibility for the cost of carrying goods with the salesperson, to ensure that an order paced actually results in a sale.


Stock control:-
Approval procedures should be arranged around several factors. You should set minimum and maximum quantities which your buyers can order without prior approval. This ensures that you are maximizing any volume discount available through your vendor and preventing over-ordering of stock.


Keeping accurate records:-

Any time items arrive at or leave a warehouse, accurate paperwork should be kept, itemizing the goods. When inventory arrives, this is when you will find breakage or loss on the goods you ordered. Inventory leaving your warehouse must be counted to prevent loss between the warehouse and the point of sale. Records should be processed quickly, at least in the same day that the withdrawal of stock occurred.


Managing employees:-
Buyers are the employees who make sock purchases for your company. Reward systems should be set in place that encourage high levels of customer’s service and return on investment for the product lines the buyer manages. Incentives programs can help employees keep this in perspective. When they see a difference in their paychecks from poor inventory management, they are more likely to take precautions to prevent shrinkage.


Question N0.2
1. What are the steps you would like to follow in the design of a most effective forecasting process? Give your suggestions after analyzing the variances in given table.


Answer:-

Keys like to follow for most effective forecast.


Time series:-
Time series forecasting methods are based on the premise that you can predict future performance of a measure simply by analyzing its past results.


These methods identify a pattern in the historical data and use that pattern to extrapolate future values. Past results can, in fact, be a very reliable predictor for a short period into the future. You can generate this type of forecast very quickly and easily, and you do not need either forecasting expertise or an in-depth knowledge of your data.


The modeling techniques used by the time-series methods are relatively simple and run very fast. Time-series forecasting is extremely useful when hundreds or thousands of items must be forecast.


Use Scenario-Based Forecasts:-

One forecast is not enough. Consider what will happen if conditions change. For example, how might your forecast change if your competitors react strongly to your strategy? How might it change if they don’t react at all? If the government changes a policy that makes your product tax free. All of these factors will influence sales, so the smart executive considers multiple scenarios. While the executive may not expect the government to make something tax free, scenarios can be created that consider favorable government regulation, stable regulation, and negative regulation, just as one can consider light competitive reaction, moderate reaction, or strong reaction.


Use Multiple Methods:-

Since forecasts are estimates, the more estimates generated from various methods, the better. For example, combining expert opinions with a trend analysis could help you not only understand what is happening but also why. Every forecast results in decisions, such as the decision to hire more people, add manufacturing capacity, order supplies, and so forth. In addition, practice makes perfect, as they say. The more forecasts you have to make and resulting decisions you have to live with, the better you will get at forecasting.


Track Actual Results and Adjust:-
As time goes on, forecasts that have been made should be adjusted to reflect reality. You must have an annual forecast, the forecast changes regularly based on how well the company is doing. Further knows how strongly competition has reacted and can adjust the company’s estimates accordingly.


Use tools wisely:-
Many companies tend to rely solely on qualitative tools-the opinions of experienced manager and salespeople derive forecast ignoring such quantitative tools as regression and time-series analysis. The key is that both quantitative and qualitative tools are integral to effective forecasting problem. Without understanding where qualitative techniques, time series and regression do and do not work effectively, it is impossible it is impossible to analyze the cost and achieve the benefits of implanting new forecasting tools.


Measure:-
Obviously, before forecaster can be rewarded for excellence, a company must first develop system for measuring performance, tools for providing feedback, and standards and targets for what constitutes forecasting excellence. Without the ability to effectively measure and track performance, there is little opportunity to identify whether changes in the development and application of forecasts are contributing to business success.

Tuesday, October 25, 2011

Mkt630 GDB No. 1 Fall 2011 solution

Discussion Objective:

To understand distinct marketing approaches which are used for the same product in its different stages of product life cycle and to realize the difference in these approaches.

Point of discussion:
Assume that a group of business editorial writers related to leading newspapers of Pakistan are discussing the current business practices in Pakistan. You are there as a third party observer of this discussion and have to closely observe what they are talking. The description of discussion is as following. One of them initiated the discussion by saying that in the recent past it has been observed in the IT equipments market of Pakistan that used IT equipment are being imported and traded in local market at a massive level. The major IT equipments being traded are personal computers (both the desktop systems and laptops), printers, monitors, key boards and mouse pointers. Then he put forth a question that what can be the possible reason behind importing these used equipments? Are most of these products faulty and out of order and so these are firstly repaired and then sold in Pakistan or there is any other reason. Another question was raised that if these products are still usable then why the foreign countries sell these to Pakistan? One editor came up with the point that might be these products are exported to Pakistan because these products were at the last stage of their product lives and were declared outdated in the foreign countries. You have now been welcomed by them to bring your own flavor in discussion and to bring the discussion to a conclusive level as they are not clear about the whole happening.

Discussion Agenda:
You have to give your opinion by responding to the questions raised and opinions given by them.

Solution:
Small scale surveys and focus groups are low cost ways to gather information from potential and existing customers. Also most of the secondary data (statistics, demographics, etc.) is available easily to the SMEs to analyze according to their needs.

Eco403 GDB No. 1 fall 2011 solution

According to CIA World Fact Book, current population growth rate of Pakistan and China are 1.57% and 0.493% respectively. In both countries, ratio of females is more than males. Logically discuss that how this increasing ratio of females will affect the Gross Domestic Product (GDP) of both countries?

Solution:

In these two countries (as well as others) women are given a lower standard of education and are usually either at home or doing low paid work. So unless they get their act together really soon there will be many vacancies for skilled workers which cannot be filled , the result will be a lower rate of increase of the GDP over the coming years compared to the rate it would rise if women were properly educated and had access to skilled work.