Showing posts with label theorem. Show all posts
Showing posts with label theorem. Show all posts

Monday, March 15, 2021

Points to Remember on OOPS in Python

 

  Points to Remember on OOPS in Python

 

* Procedure oriented Programming Approach is the methodology where programming is done using procedures and functions .

 

* Procedure Oriented Programming Approach is generally followed by languages like C , Pascal and Fortran

 

* Python programming can take up programming using procedure oriented approach ( like C ) or Object Oriented Programming Approach ( like Java and C++ ) depending upon requirement .

 

* An object is anything that really exists in the world and can be distinguished from other objects . It is like an entity which has a unique existence and also displays some form of attributes and behaviours.

 

* Every Object has some behaviour that is characterised by attributes and actions . Here , attributes means the manner of conductance of any action . Attributes are represented by variables and actions are performed by methods . So , an object contains variables and methods .

 

* A function which is written inside a class is called as Method .

 

* A Class is a model or Blueprint for the creation of objects . And , a class contains variables and methods .

 

* Objects are created from a Class * An object does nothing without a class , however a class can exist without any object .

 

* Encapsulation is a mechanism where the data ( variables ) and the code ( methods ) that act on the data are bound together .

 

* Class is an example for Encapsulation since it contains both data and code .

 

* Hiding the unnecessary data and code from the user is called as Abstraction .

 

* In order to hide variables or methods , one should declare the variables or methods are private members . This is done by writing two underscores before the names of the variable or the methods .

 

* Private Members can be accessed using "Name Mangling" where the class name is used with single underscore before it and two underscores after it in the form of :

 

instancename._Classname_variable

instancename._Classname_method()

 

 

* Creating new classes from existing classes so that new classes would acquire all the features of the existing classes is called as Inheritance .

 

* In Inheritance , the first class generally created is called as Base Class or Super Class . The newly created Class is called as Sub-Class or Derived Class .

 

* Polymorphism represents the ability of an object or method to assume several different forms

 

* The Programming Languages which follow all the five features of OOPS namely : classes and objects , Encapsulation , Abstraction , Inheritance and Polymorphism are called as Object Oriented Programming Languages . For example: C++ , Java and Python fall into this category of Programming Languages .

 

Classes and Objects in OOPS - a short introduction in Python

 


     Classes and Objects in OOPS

 

* A Class is a model or plan to create objects . This means , one can write a class with the attributes and actions of objects .

 

* Attributes are represented by variables and actions are performed by methods. Therefore , a class contains both variables and methods .

 

* The same variables and methods are also available within the objects because the objects are created from the class to which the variables and methods belong.

 

* These variables are also called as 'instance variables' because these instance variables can be created inside an instance like an object .

 

* One should remember the difference between a function and a method. A function which is written inside a class is called as a Method.

 

* Generally, a Method is called using one of the following two ways :

1) classname.methodname()

2) instancename.methodname()

 

 

* The general format of a class is given in the following manner:

Class Classname(object):

def _init_(self):

def method01():

def method02():

 

Friday, March 12, 2021

Concept of Abstraction in OOPS


Concept of Abstraction in OOPS

 * There may be a lot of data present within a class but the user using the system application may not need the entire data present within a class. The user requires only some part of the available data in the Class. In the following case, one can hide the unnecessary data from the user and expose only those data that is of interest to the user . This concept is called as Abstraction.

 * A good example for depicting the concept of Abstraction is that of a Car. Any Car would have some parts like Engine , Radiator , Battery , Mechanical and Electrical Equipment etc .

 * The user of a car ( driver ) should know how to drive a car and the driver may not require any knowledge of the parts of the car . For example , a driver is never bothered about how the engine is designed and the internal parts of the engine . This is the main reason why the car manufacturers hide their parts from the driver in a separate panel which is generally at the front part of the car .

 * The sole advantage for usage and putting into practice the concept of Abstraction is that every user would be able to get their own view of the data according to their own requirement and the user will not get confused with so much unnecessary data .

 * A Bank Clerk should only see the customer details like Account Number , Name and Balance Amount within an account . He should not be entrusted with access into sensitive data like the staff 's salaries , profit or loss of the bank , interest amount paid by the bank , loan amount to be recovered etc . Therefore , sensitive data should be abstracted from the Clerk's view . The Bank Manager however may require the sensitive data and thus it could be provided to the Bank Manager .

 

Sunday, February 14, 2021

Theorems on Variance with relation to Expectation and Mean

 


Concept on Variance and Standard Deviation

 


Theorems on Mathematical Expectation and Probability Values

 


Functions of Random Variables with probability function

 


Definition of Mathematical Expectation of Values with an example

 


Definition of Mathematical Expectation of Probabilities - Concept Theory expression

 part- 1


part-2




Concept Theory on Joint Distributions for two or more than two variables within a limit

 


A Graphical Representation of a Probability Distribution Function within limits - Example

 


Question to find the Distribution Function for Random Values with range limits

 


Depiction of Continuous Random Variables for a function of "X" where probability of value is in constraints

 


Tuesday, February 9, 2021

Question on Permutation and Combination as a precursor to usage in Probability concept

 


Calculation of Probability from draw of coloured balls from a box filled with numerous other coloured balls

 


Calculation of Probability of turning of a specific number from a throw of dice with multiple occurrence of same event

 




Calculation of Probability of Events using draw of cards from a deck of cards from a box

 


Calculation of Probability of Events by finding out probability of drawing balls from a deck of 52 cards

 


Calculation of Probability of Events by finding out probability of balls drawn at random from a box