OOP Principles in Python

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Listen to an AI-generated conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

In object-oriented programming, what is the primary goal of using subclasses to inherit from a base class?

  • To prevent modification of the base class.
  • To ensure that all objects are of the same type.
  • To reuse code and extend functionality in a structured way. (correct)
  • To increase the complexity of the code.

What characteristic defines a qualitative variable?

  • It cannot be expressed in numerical form. (correct)
  • It can always be measured numerically.
  • It always expresses quantity.
  • It can be arranged by numerical value.

Which of the following is an example of a qualitative variable?

  • Hair color (correct)
  • Income
  • Height
  • Weight

Which of the following is the most accurate definition of a 'finite population'?

<p>A population with a limited number of units. (A)</p>
Signup and view all the answers

If '-2' is specified as the number of decimal places, how would the number 1234.567 be rounded?

<p>1200 (D)</p>
Signup and view all the answers

Which type of research primarily focuses on gathering numerical data to identify patterns and test hypotheses?

<p>Quantitative Research (C)</p>
Signup and view all the answers

What is the purpose of 'Literature Review' in the research process?

<p>To understand existing knowledge on the topic. (D)</p>
Signup and view all the answers

What is the correct formula for finding the range?

<p>Range = x_max - x_min (A)</p>
Signup and view all the answers

What is the main characteristic of 'absolute measure of dispersion'?

<p>It expresses the scattering of observation in terms of distances. (C)</p>
Signup and view all the answers

What does 'Tabulation' refer to in the presentation of data?

<p>Summarizing classified data in the form of a table. (C)</p>
Signup and view all the answers

When constructing a frequency distribution table, what does 'class size' refer to?

<p>The range of values within each class. (B)</p>
Signup and view all the answers

What is the main difference between an 'inclusive' and an 'exclusive' type of class when creating class intervals?

<p>Inclusive classes include both upper and lower limits, while exclusive classes exclude one of the limits. (D)</p>
Signup and view all the answers

In the formula for Sturges' rule, what does 'k' represent? '[k = 1 + 3.322log(n)]'

<p>The number of classes. (A)</p>
Signup and view all the answers

Which of the following is a chart that plots points at the class mark?

<p>Frequency Polygon (C)</p>
Signup and view all the answers

Why is the sample mean highly used for interval and ratio data?

<p>Because it is highly applicable (A)</p>
Signup and view all the answers

What does the symbol L mean in the median of grouped data?

<p>Lower limit class boundary of the median class. (C)</p>
Signup and view all the answers

What is the most accurate definition of Mode?

<p>Is the most frequently occurring values in a given distribution of data. (D)</p>
Signup and view all the answers

What is the definition of Basic (Fundamental) Research stated in the document?

<p>Focuses on gaining a deeper understanding of phenomena (B)</p>
Signup and view all the answers

What is the definition of Applied Research stated in the document?

<p>Focuses on solving practical problems (A)</p>
Signup and view all the answers

Solve for the Quartile 1 with +1 formula. Given a set of observations 11, 13, 16, 7, 16, 21, 9, 18. Find Q1.

<p>Q1 = 9.5 (D)</p>
Signup and view all the answers

Solve for the Decile 5 with +1 formula Given a set of observations 11, 13, 16, 7, 16, 21, 9, 18. Find D5.

<p>D5 = 14.5 (B)</p>
Signup and view all the answers

Solve for the Percentiles 77 with +1 formula Given a set of observations 11, 13, 16, 7, 16, 21, 9, 18. Find P77.

<p>P77 = 17.86 (C)</p>
Signup and view all the answers

What is the symbol that is used for class mark?

<p>x (A)</p>
Signup and view all the answers

What is the symbol that is used for class frequency?

<p>f (D)</p>
Signup and view all the answers

What is the symbol that is used for class boundaries?

<p>CB (B)</p>
Signup and view all the answers

What is the symbol that is used for cuFrequency?

<p>CF (C)</p>
Signup and view all the answers

Which of the following is an example of nominal scale?

<p>Blood Group (D)</p>
Signup and view all the answers

Which of the following is an example of a ratio scale?

<p>Weight (B)</p>
Signup and view all the answers

For the test scores: 43, 52, 72, 43, 60. What would be the most suitable name for the type of frequency distribution?

<p>Ungrouped Frequency Distribution (B)</p>
Signup and view all the answers

For the age of voters given a list from 18 -90: What would be the most suitable name for the type of frequency distribution?

<p>Grouped Frequency Distribution (A)</p>
Signup and view all the answers

Given test scores data: 70, 83, 87, 76, 80 Find the following range.

<p>Range = 23. (A)</p>
Signup and view all the answers

Given data: 7, 9, 11, 13, 16, 16, 18, 21 What is the value obtained for the quartile deviation?

<p>QD = 3.5. (B)</p>
Signup and view all the answers

What is a data having an existing data set from other people called?

<p>Secondary Data (C)</p>
Signup and view all the answers

What type of scale is being asked if you ask of someone’s civil status?

<p>Nominal Scale (C)</p>
Signup and view all the answers

What is referred by for in presentation of data? A systematic arrangement of classified data in columns and rows.

<p>Tabulation Data (A)</p>
Signup and view all the answers

What is the other name for absolute distance mean?

<p>MAD (C)</p>
Signup and view all the answers

If a data set has the following values: 40, 38, 42, 40, 39, 39, 43, 40, 39, 40; what is the range for this data set?

<p>5 (D)</p>
Signup and view all the answers

Which of the following examples in this study is an example of basic/fundamental type of research?

<p>Studying how cells function at a molecular level (A)</p>
Signup and view all the answers

Flashcards

What is Research?

A systematic process to discover new knowledge, understand phenomena, or solve problems, through investigation, analysis and experimentation.

Importance of Research

The research contributes to the the increase of what we know, the generation of new technologies, and better problem solving

Purpose of Research

Expanding our understanding, addressing challenges, validating theories and developing new technologies.

Basic (Fundamental) Research

Focuses on gaining understanding of phenomena, studying how cells function.

Signup and view all the flashcards

Applied Research

Focuses on solving practical problems and creating new technologies.

Signup and view all the flashcards

Qualitative Research

Focuses on understanding experiences and behaviors using interviews and case studies.

Signup and view all the flashcards

Quantitative Research

Uses numerical data to identify patterns and test hypotheses through statistical analysis.

Signup and view all the flashcards

Research Methods

A process to techniques, strategies, and procedures used to gather data, analyze information, and answer research questions and systematically explore a problem, test hypotheses, and contribute to knowledge.

Signup and view all the flashcards

Formulating Hypothesis

A testable prediction based on existing knowledge or theory.

Signup and view all the flashcards

Specifying '2' Number of Decimal Places

The number will be rounded to the hundredths place. For example: 1234.567 becomes 1234.57

Signup and view all the flashcards

Specifying '1' Number of Decimal Places

The number will be rounded to the tenths place. For example: 1234.567 becomes 1234.6

Signup and view all the flashcards

Quartiles

Dividing the items in a distribution into four equal parts.

Signup and view all the flashcards

Deciles

Dividing data set into ten equal and ordered parts.

Signup and view all the flashcards

Percentiles

Dividing data set into one hundred equal and ordered parts.

Signup and view all the flashcards

Measurement of Variability

Measures of dispersion indicate data heterogeneity

Signup and view all the flashcards

Absolute Measure of Dispersion

An absolute measure of dispersion expresses scattering of observation in terms of distances or deviations

Signup and view all the flashcards

Relative Measure of Dispersion

Use a relative measure of dispersion to comparing distributions of two or more data sets

Signup and view all the flashcards

Range

The difference between two extreme observations of the data set.

Signup and view all the flashcards

Quartile Deviation (QD)

Also called a semi-interquartile range.

Signup and view all the flashcards

Class Width

Class intervals are groupings of category defined by a lower limits and the upper limit.

Signup and view all the flashcards

Class Boundaries (CB)

It's the true limits which is situated between the upper limits of one interval and the lower limit of the next interval.

Signup and view all the flashcards

Class Interval / Class Limits

It's range of values into which data is grouped for the purpose of organizing, summarizing, and analyzing data efficiently.

Signup and view all the flashcards

Finite Population

A population having a finite number of units or individuals or items.

Signup and view all the flashcards

Infinite Population

A population having a infinite number of units or individuals or items.

Signup and view all the flashcards

What is a Sample?

A representative and considerably small part of the population.

Signup and view all the flashcards

Definition of a Variable

It contains containing to or more variables and measures a characteristic often but not always quantitatively, containing two or more values or categories that can vary from person to person, place to place and time to time.

Signup and view all the flashcards

Qualitative Variable

The characteristics that can not be expressed in any numerical form.

Signup and view all the flashcards

Primary Data

The data which are obtained by direct observations from the population or sample.

Signup and view all the flashcards

Secondary Data

The data which are already obtained by some other persons or organizations and are already published or utilized.

Signup and view all the flashcards

Nominal Scale Measurement

Classify data in to mutually exclusive and have no logical order.

Signup and view all the flashcards

Ordinal Scale Measurement

Numbers are assigned to the categories or variables for identification as well as ranking is called Ordinal scale.

Signup and view all the flashcards

Frequency Polygon

Frequency polygon are ploted at the class mark ( midpoint ) of the classes.

Signup and view all the flashcards

Histogram

Bar graph Plotted at the exact lower limits of the classes or having based on the horizontal axis which

Signup and view all the flashcards

Frequency Distribution

a tabular representation or arrangement of data by classes or categories together with their corresponding frequencies.

Signup and view all the flashcards

Standard Deviation

It is the positive square root of the mean of the squared deviations from their mean

Signup and view all the flashcards

What is Median

The middlemost value in the distribution of an array of data.

Signup and view all the flashcards

Study Notes

OOP Methodologies

  • Focuses on Inheritance, Encapsulation, Polymorphism, and Abstraction using the Python language.
  • It presents the implementation of the 4 OOP methodologies in Python, incorporating a menu-driven approach.
  • The goal is to implement OOP principles and write structured and reusable code.
  • The code should be personalized with the student's surname to name classes.

OOP Principles Menu

  • The menu includes options for:
    • Inheritance
    • Encapsulation
    • Polymorphism
    • Abstraction
    • Exit
  • The program continues to run until the user selects the Exit option.

Inheritance

  • A base class named after the student's surname is created
    • Example: GarciaVehicle
  • Attributes like brand and model are added to the base class.
  • Two child classes inherit from the base class
    • Example: GarciaCar and GarciaMotorcycle
  • The child classes have unique attributes
    • num_wheels (car) and helmet_included (motorcycle).
  • The super() function is used to inherit attributes from the parent class.
  • A method is included to display information about the vehicle.
  • Output example includes the brand, model and number of wheels or helmet included based on option selected.

Encapsulation

  • A class with private attributes and getter/setter methods named after the student's surname is created
    • Example: GarciaMember
  • A private attribute is added, such as _password.
  • Access to the private attribute is controlled using getter and setter methods.
  • An attribute is added for a favorite color, with a display method.

Polymorphism

  • A base class is created with a speak() method that returns "Some sound".
  • Two child classes override the speak() method to return different sounds
    • One child class mentions pet's name.
  • Examples include pet sounds or other relevant outputs.

Abstraction

  • An abstract class with an abstract method is created.
  • The abstract class would be named after the student
    • Example: GarciaLibraryItem.
  • A get_details() abstract method is defined.
  • Two child classes implement the get_details() method.
    • Examples: GarciaBook and GarciaMagazine
  • The expected output shows the details retrieved through the implemented method.

Research Overview

  • Research is a systematic inquiry aimed at new knowledge, understanding phenomena, or problem-solving through investigation, analysis, and experimentation.
  • Its importance lies in knowledge advancement, innovation driving, and informing decisions across fields like science, medicine, business, and the humanities.
  • Research expands understanding, addresses challenges healthcare, business, etc., tests hypotheses, and is the base for technologies and solutions.

Types of Research

  • Basic (Fundamental) Research:
    • Focuses on understanding phenomena.
    • Example: Studying cells at a molecular level.
  • Applied Research:
    • Focuses on solving practical problems.
    • Example: Developing a new drug/vaccine.
  • Qualitative Research:
    • Focuses on human experiences and behaviors.
    • Involves interviews, case studies, ethnography.
  • Quantitative Research:
    • Involves numerical data to test patterns and hypotheses.
    • Relies on analysis

Research Process Steps

  • Identifying the Problem/Research Question: Define the research focus.
  • Literature Review: Review background
  • Formulating Hypothesis: Develop a testable prediction based on theory.
  • Data Collection: Gather data through experiments, surveys, interviews.
  • Analysis: Interpreting data to see relationships.
  • Conclusion: Arrive at conclusion, implications for future investigation.
  • Reporting Results: Communicate through papers, reports.

Research Methods Defined

  • These are techniques and strategies used to gather data, analyze information, and answer questions.
  • The goal of these strategies is to explore a problem and contribute to knowledge

Rounding Numbers

  • The number of decimal places is specified with "2": The number is rounded to the hundredths place.
  • If "1" is specified as the number of decimal places: The number is rounded to the tenths place.
  • If "0" is specified as the number of decimal places: The number is rounded to the ones place.
  • If "-1" is specified as the number of decimal places: The number is rounded to the tens place.
  • If "-2" is specified as the number of decimal places: The number is rounded to the hundreds place.

Other Measures of Location or Position

  • Quartiles
    • Divides data into four equal parts.
    • Deciles
      • Divides data into ten equal parts.
    • Percentiles
      • Divides data into one hundred equal parts.

Quartiles

  • Divides the items in the distribution into four (4) equal parts.
  • Arranges data in increasing order first.
  • Formula for ungrouped data and a method for applying if computed calue is a decimal or a whole number
  • The formula is: Q1.4 = n / 4
    • If the computed value is a decimal number, round UP to the nearest integer.
    • If the value is a whole number, take the average of that data and the next data.
  • Another solution is to use a with n+1:
    • Formulas are Q1 = (n+1) / 4
    • To Q4= 4(n+1)
  • The formula to get result for grouped data is: Q 1..4 = LQ1..4 + i
  • [ --<CF] /f
    • LQ1 is the lower CB of the identified quartile position
    • <CF is the cumulative frequency before the identified quartile position, f is the frequency and i is the class size.

Deciles

  • Similar concept to quartile but for 10 equal values.
  • The formula is represented as D..10 = n/10
  • Formula to get result for grouped data is: D 1..10 = LD1..10 + i -[ --<CF] /f
  • LQ1 is the lower CB of the identified decile position
  • <CF is the cumulative frequency before the identified decile position, f is the frequency and i is the class size.

Percentiles

  • Similar concept to quartile and deciles, but for 100 equal values.
  • The formula is represented as P..100 = n/100
  • Formula to get result for grouped data is: P 1..100 = LP1..100 + i -[ --<CF] /f
  • LQ1 is the lower CB of the identified percentile position
  • <CF is the cumulative frequency before the identified percentile position, f is the frequency and i is the class size.

Measurement of Variability

  • Also known as measures of dispersion or spread.
  • Indicates the amount of heterogeneity or variety within a distribution of scores.
  • A measure of dispersion should be rigidly defined
  • It must be easy to calculate and understand
  • Not affected much by the fluctuations of observations
  • Based on all observations

Classification of Measures of Dispersion

  • Absolute measure of dispersion:
    • Expresses the scattering of observation in terms of distances or variations relative to the average e.g., Range, Quartile Deviation, Mean Deviation, Variance, and Standard Deviation.
  • A relative measure of dispersion:
    • Used for comparing distributions of two or more data sets and for unit free comparison e.g., coefficient of range, variation ,deviation etc.

Range

  • Common and understandable measure which gets the difference betweem two extreme observation.
  • Denoted as Range =x max - x min
  • Where x max the largest measure and x min is the smallest

Merits of range

  • It is the simplest of the measure of dispersion
  • Easy to calculate & understand Easy
  • Independent of change of origin.

Demerits of range

  • It is based on two extreme observations. Hence, get affected by fluctuations
  • A range is not a reliable measure of dispersion
  • Dependent on change of scale

Quartile Deviation (QD)

  • Its also called a semi-interquartile range
  • It is a kind of range
  • The formula for ungrouped Data is:
    • The formula is Q3-Q1 / 2
  • The Formula to get result for grouped data is: -The formula is Q₁ = LQ₁ + i

Mean Absolute Deviation (MAD)

  • Shows the absolute distance from the mean of the given score value.
  • The formula for ungrouped: -Σ|x-x|/ n
  • The formula for grouped: -Σf|x -x | / n

Standard Deviation

  • Is the positive square root of the mean of the squared deviations. It is the most important measure of dispersion which is also known as root mean sqaure deviation
  • For ungrouped data: -S = √ [Σ(x−x) 2 / n-1]
  • For grouped data: S = √ [Ef(x −x) 2/ n-1]

Variance

  • Is the square of standard deviation. -Is the arithmetic mean distribution generally denoted .

  • For ungrouped data:

    -2S2 = [Σ(x−x)2 /n−1]

  • For grouped Data:

    -S2 = [Σf(x−x)² /n−1]

What Is Population

  • Means the aggregate of human individuals in a defined area or region
  • In statistics, it refers to an aggregate of all indiviual or items defined on some common characterisitsc
    • e.g. all the students in a class, students of a university.
  • There can also be a finite population
    • e.g. numbers with a finite number of units/individuals.
    • infinite population (in number) - number of coin tosses/outcomes to infinite

Sample

  • Is the individual number if it is said to be representing a set of a big population
  • A number of inviduals/items in the sample are defined as a sample size.
  • It is usually denoted by "n"
  • These are characteristics always quantitavely measured containing two or more values which can vary from person to person

Examples Of Variable

  • Gender.
  • Family Size.
  • Price of commodity
  • Height of person
  • Weight of person

Classification

  • Is either categorized as qualitative (Catagoral)
  • Or quantitative - Numerical

Qualitative Variable

  • The characteristics that can not be expressed in any are called Qualitative variables.

Quantative

  • Is the one with multiple numerical ordering. e.g. age ,height .income

Source Of Data

  • There are generally two different set of data
    • Primary - obtained by personal experience to labor with money
    • Secondary - Obtained by second hand and usually published or utilized to hospitals etc

Scales Of Measurement

The measurement scales are,

  • Nominal Scale - Qualitative Data
  • Levels of measurements which classify data in to mutually exclusive and have no logical order
    • e.g: religion, marital Status.
  • Ordinal Scale - Qualitative Data -Qualitative Data

Different between the two

  • Interval Scale:*
    • Measure is meaningfully set zero with no real value. Qty
  • Ratio Scale*
  • Measure is not set to 0 with real value.

Frequency Distribution

Frequency can be described as follow:

  1. Construct a frequency distribution table
  2. Define basic concepts in frequency distribution
  3. Draw a graphical representation of frequency distribution table
  • Statistical data can be presented:* -Classification and Tabulation -Graphical Presentation

What Is Distribution?

  • distribution is the process organizing, summarizing, and analyzing data efficiently with a class interval, define by the two values
  • both the upper and lower numbers are defined and used at each value while discrete data
  • exclusive uses upper number not included but the bottom still does.

How To Construct a Freq. Table?

  1. Get the lowest and the highest value in the distribution. We shall mark the highest and lowest value in the distribution.
  2. Get the value of the range. The range denoted by R, refers to the difference between the highest and the lowest value in the distribution. Thus, -R=H-L
  • Determine the number of classes In the determination of the number of classes, it should be noted that there is no standard method to follow.
  • Use the classC = R/k.

3 Methods or Charts Which Represent Frequency

  • Charts To Rep Frequency*
  1. Freq. Polygon
  • Is a Line Graph
  • The points are plotted at the class mark of the classes
  1. Histograms
  • Is a bar chart
  • Has the base centered on the chart.
  1. Ogive Is Line Graph
  • Where cf means is lower than
  • Means is higher/ greater than

Measures Of Location

  • Means it's commonly used to measure which usually averages from a data
  • The population data is as follow: sum up the data and divide that data over it's number
  • There is another form in mean which is in terms with a grouped number
    • that uses "AM" guessed mean value. ( locate the class mark of the highest- class frequency

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser