M.P Birla Foundation H.S.
School
Unit Assessment II (2015-16)
Computer Science
Class XI
Full Marks :[15+10]
Question 1
a) The MOBIUS function M(N) for a natural number N is defined as follows:
M(N) = 1 if N = 1 [Condition 1]
M(N) = 0 if any prime factor of N is contained in N more than
once [Condition 2]
M(N) = (-1)p if N is a product of ‘p’ distinct prime factors [Condition
3]
Example :
M(78) = -1 ( for 78 = 2 * 3 * 13 M(78) = ( -1)3 = -1 )
M(34) = 1 ( for 34 = 2 * 17 M(34) = ( -1)2 = 1 )
M(12) = 0 ( for 12 = 2 * 2 * 3 M(12) = 0 for 2 appears two times)
M(17) = -1 ( for 17 = 17 M(17) = ( -1)1 = -1 )
Design a class MobiusFn to define Mobius function for a natural number n.
Class name : MobiusFn
Data members/Instance variables:
n : stores an integer number
Member functions:
MobiusFn() : default constructor
void input() : input value of n
int primeFac() : to check and count prime factors of n
void display() : to find and print values of Mobius function
Specify the class MobiusFn giving details of the constructors, void input(), int
primeFac(), and void display(). Also define the main function to create an
object and call methods accordingly to enable the task.
[10]
b) Code / Type the program on the computer and get a printout (hard copy). Typically
this should be a program that compiles and runs correctly. [10]
Question 2
a) Given the Boolean function F(A,B,C,D) = Σ(1,6,7,8,9,10,14,15)
Use Karnaugh’s map to reduce the function F, using the SOP form. Draw a
logic gate diagram for the reduced SOP form. You may use gates with more than 2 inputs.
Assume that the variables and their complements are available as inputs.
b) Given X(A,B,C,D)= Π(0,2,3,4,5,11,12,13)
Use Karnaugh’s map to reduce the function X, using the POS form. Draw a
logic gate diagram for the reduced POS form. You may use gates with more than 2 inputs.
Assume that the variables and their complements are available as inputs. [ 2 ½ +2 ½]
The MOBIUS function M(N) for a natural number N is defined as follows:
M(N) = 1 if N = 1 [Condition 1]
M(N) = 0 if any prime factor of N is contained in N more than once
[Condition 2]
M(N) = (-1)p if N is a product of ‘p’ distinct prime factors [Condition 3]
Example :
M(78) = -1 ( for 78 = 2 * 3 * 13 M(78) = ( -1)3 = -1 )
M(34) = 1 ( for 34 = 2 * 17 M(34) = ( -1)2 = 1 )
M(12) = 0 ( for 12 = 2 * 2 * 3 M(12) = 0 for 2 appears two times)
M(17) = -1 ( for 17 = 17 M(17) = ( -1)1 = -1 )
Design a class MobiusFn to define Mobius function for a natural number n.
Class name : MobiusFn
Data members/Instance variables:
n : stores an integer number
Member functions:
MobiusFn() : default constructor
void input() : input value of n
int primeFac() : to check and count prime factors of n
void display() : to find and print values of Mobius function
Specify the class MobiusFn giving details of the constructors, void input(), int primeFac(),
and void display(). Also define the main function to create an object and call methods
accordingly to enable the task.