What are Python’s built-in data types?

Python offers a variety of built-in data types that are designed to handle different kinds of data efficiently.

Numeric Types:

  1. int (Integer):
    • Represents whole numbers without a fractional component.
    • Example: a = 10
  2. float (Floating Point):
    • Represents real numbers with a fractional component.
    • Example: b = 10.5
  3. complex (Complex Number):
    • Represents complex numbers with a real and an imaginary part.
    • Example: c = 3 + 4j

Sequence Types:

  1. str (String):
    • Represents a sequence of characters (text).
    • Example: s = “Hello”
  2. list (List):
    • Represents an ordered collection of items, which can be of mixed types.
    • Example: l = [1, 2, 3, “four”]
  3. tuple (Tuple):
    • Represents an ordered collection of items, which can be of mixed types.
    • Example: t = (1, 2, 3, “four”)
  4. range:
    • Represents an immutable sequence of numbers, commonly used for looping a specific number of times in for loops.
    • Example: r = range(5)

Mapping Type:

  1. dict (Dictionary):
    • Represents a collection of key-value pairs.
    • Example: d = {“key1”: “value1”, “key2”: “value2”}

Set Types:

  1. set:
    • Represents an unordered collection of unique items.
    • Example: s = {1, 2, 3, 4}
  • frozenset:
    • Represents an immutable version of a set.
    • Example: fs = frozenset([1, 2, 3, 4])

Boolean Type:

  • bool:
    • Represents Boolean values: True and False.
    • Example: flag = True

Binary Types:

  • bytes:
    • Represents an immutable sequence of bytes.
    • Example: b = b’hello’
  • bytearray:
    • Represents a mutable sequence of bytes.
    • Example: ba = bytearray(b’hello’)
  • memoryview:
    • Represents a view object that exposes the memory of another binary object (like bytes or bytearray) without copying.
    • Example: mv = memoryview(b’hello’)

None Type:

  • NoneType:
    • Represents the absence of a value or a null value.
    • Example: n = None

Examples and Usage:

Numeric Types:

a = 10        # int

b = 10.5      # float

c = 3 + 4j    # complex

Sequence Types:

s = “Hello”             # str

l = [1, 2, 3, “four”]   # list

t = (1, 2, 3, “four”)   # tuple

r = range(5)            # range

Mapping Type:

d = {“key1”: “value1”, “key2”: “value2”}   # dict

Set Types:

s = {1, 2, 3, 4}                     # set

fs = frozenset([1, 2, 3, 4])         # frozenset

Boolean Type:

flag = True   # bool

Binary Types:

b = b’hello’              # bytes

ba = bytearray(b’hello’)  # bytearray

mv = memoryview(b’hello’) # memoryview

None Type:

n = None  # NoneType

What are Dynamic-typed and Strongly typed Languages?

Dynamic-typed and Strongly typed languages are two concepts in programming languages related to how variables are handled and how type rules are enforced.

DynamicTyped Languages:

In dynamically typed languages, the type of a variable is determined at runtime rather than at compile-time. This means you don’t need to explicitly declare the type of a variable when you write the code. The interpreter infers the type based on the value assigned to the variable.

Characteristics:

  • Runtime Type Checking: The type of a variable is checked during execution, allowing variables to change type on the fly.
  • Flexibility: Since variables can change types, dynamically typed languages offer more flexibility and can be more concise and easier to write.
  • Potential for Runtime Errors: Because type errors are not caught until the code is executed, there’s a higher potential for runtime errors.

Examples:

  • Python:

x = 5      # x is an integer

x = “Hello”  # now x is a string

  • JavaScript:

let x = 5;      // x is a number

x = “Hello”;    // now x is a string

Strongly Typed Languages:

A strongly typed language enforces strict type rules and does not allow implicit type conversion between different data types. This means that once a variable is assigned a type, it cannot be used in ways that are inconsistent with that type without an explicit conversion.

Characteristics:

  • Type Safety: Strongly typed languages prevent operations on incompatible types, reducing bugs and unintended behaviors.
  • Explicit Conversions: If you need to convert between types, you must do so explicitly, ensuring that the programmer is aware of and controls the conversion.
  • Compile-Time and Runtime Checks: Type enforcement can happen both at compile-time and runtime, depending on the language.

Examples:

  • Java (strongly typed, statically typed):

int x = 5;

// x = “Hello”;  // This would cause a compile-time error

  • Python (strongly typed, dynamically typed):

x = 5

# x + “Hello”  # This would cause a runtime TypeError

Combining Both Concepts:

Languages can be both dynamic and strongly typed. This means they determine types at runtime but enforce strict type rules once those types are known. Python is a prime example of this combination:

  • Python:

x = 10  # x is an integer

y = “20”  # y is a string

# z = x + y  # This raises a TypeError because you can’t add an integer to a string without explicit conversion

Static vs. Dynamic and Strong vs. Weak Typing:

It’s important to distinguish between the dynamic/static and strong/weak typing spectra:

  • Static Typing: Types are checked at compile-time (e.g., Java, C++).
  • Dynamic Typing: Types are checked at runtime (e.g., Python, JavaScript).
  • Strong Typing: Strict enforcement of type rules (e.g., Python, Java).
  • Weak Typing: More permissive type rules and implicit conversions (e.g., JavaScript).

How do you manage Memory in Python?

Memory Management in Python is handled automatically by the Python memory manager. This manager is responsible for allocating and deallocating memory for Python objects, thus relieving developers from having to manually manage memory.

Key Components of Python Memory Management:

  1. Reference Counting:

    • Python uses reference counting as the primary memory management technique. Each object maintains a count of references pointing to it.
    • When a new reference to an object is created, the reference count is incremented. When a reference is deleted, the count is decremented.
    • If the reference count drops to zero, the memory occupied by the object is deallocated, as there are no references pointing to it anymore.
  1. Garbage Collection:

    • To deal with cyclic references (situations where a group of objects reference each other, creating a cycle and thus preventing their reference counts from reaching zero), Python includes a garbage collector.
    • The garbage collector identifies these cycles and deallocates the memory occupied by the objects involved. Python’s garbage collector is part of the gc module, which can be interacted with programmatically.
  1. Memory Pools:
    • Python uses a private heap for storing objects and data structures. The memory manager internally manages this heap to allocate memory for Python objects.
    • For efficient memory management, Python employs a system of memory pools. Objects of the same size are grouped together in pools to minimize fragmentation and improve allocation efficiency.
    • The pymalloc allocator is used for managing small objects (less than 512 bytes) and works within these memory pools.

Techniques for Managing Memory Efficiently:

  1. Using Built-in Data Structures Wisely:

    • Choose appropriate data structures that suit your use case. For instance, use lists for collections of items, dictionaries for key-value pairs, and sets for unique elements.
    • Avoid creating unnecessary large objects and prefer using iterators and generators to handle large datasets efficiently.
  1. Avoiding Memory Leaks:

    • Ensure that objects are no longer referenced when they are no longer needed. This can often be managed by limiting the scope of variables and using context managers (with the with statement) to handle resources.
    • Be cautious with global variables and long-lived objects that may inadvertently hold references to objects no longer needed.
  1. Manual Garbage Collection:

    • Although automatic, you can manually control the garbage collector to optimize performance in certain situations.
    • Use the gc module to disable, enable, and trigger garbage collection explicitly when dealing with large datasets or complex object graphs.
    • Example: gc.collect() can be called to force a garbage collection cycle.
  1. Profiling and Optimization:

    • Utilize memory profiling tools to understand memory usage patterns. Tools like memory_profiler, tracemalloc, and objgraph can help identify memory bottlenecks and leaks.
    • Optimize memory usage based on profiling results by refactoring code, reusing objects, and using efficient algorithms.

What is PEP 8?

PEP 8, officially titled “PEP 8 — Style Guide for Python Code,” is a document that provides guidelines and best practices for writing Python code. Created by Guido van Rossum and first published in 2001, PEP 8 aims to improve the readability and consistency of Python code by providing a set of conventions for formatting, naming, and structuring code.

Key Components of PEP 8:

  1. Code Layout:
    • Indentation: Use 4 spaces per indentation level. Avoid using tabs.
    • Maximum Line Length: Limit all lines to a maximum of 79 characters. For docstrings or comments, the maximum line length is 72 characters.
    • Blank Lines: Use blank lines to separate top-level function and class definitions, and to divide the code into logical sections.
  2. Imports:

    • Import statements should be placed at the top of the file, just after any module comments and docstrings, and before module globals and constants.
    • Imports should be grouped in the following order: standard library imports, related third-party imports, and local application/library-specific imports. Each group should be separated by a blank line.
    • Avoid wildcard imports (e.g., from module import *).
  3. Whitespace in Expressions and Statements:

    • Avoid extraneous whitespace in the following situations:
      • Immediately inside parentheses, brackets, or braces.
      • Immediately before a comma, semicolon, or colon.
      • Immediately before the open parenthesis that starts the argument list of a function call.
      • Around operators, except for assignment operators.
  4. Comments:

    • Comments should be complete sentences. Use capital letters and periods.
    • Place inline comments on the same line as the statement they refer to, separated by at least two spaces.
    • Use block comments to explain code that is complex or not immediately clear.
  5. Naming Conventions:

    • Follow standard naming conventions: use lowercase with words separated by underscores for functions and variable names (e.g., my_function).
    • Use CamelCase for class names (e.g., MyClass).
    • Use UPPERCASE with underscores for constants (e.g., MY_CONSTANT).
  6. Programming Recommendations:

    • Use is to compare with None, not ==.
    • Avoid using bare except clauses. Specify the exception being caught.

Importance of PEP 8:

Adhering to PEP 8 is important because it ensures consistency and readability in Python code, making it easier for developers to understand and collaborate on projects. It serves as a universal standard for Python code style, promoting best practices and helping maintain a clean and professional codebase.

How is Python an interpreted language?

Python is considered an interpreted language because its code is executed by an interpreter at runtime rather than being compiled into machine code beforehand.

Interpreter Workflow:

  1. Source Code Execution:

When you write Python code, you create a script or a program in a .py file. This file contains human-readable instructions written in Python’s syntax.

  1. Interactive Interpreter:

Python can be executed interactively, meaning you can write and execute one line or block of code at a time using the Python shell (REPL – Read-Eval-Print Loop). This is particularly useful for testing and debugging small code snippets.

  1. Bytecode Compilation:

When you run a Python program, the Python interpreter first translates the human-readable source code into an intermediate form called bytecode. Bytecode is a lower-level, platform-independent representation of your source code.

This bytecode compilation happens automatically and is typically stored in .pyc files in the __pycache__ directory.

  1. Execution by Python Virtual Machine (PVM):

The bytecode is then executed by the Python Virtual Machine (PVM). The PVM is an interpreter that reads the bytecode and translates it into machine code instructions that the host computer’s processor can execute.

Characteristics of an Interpreted Language:

  • Dynamic Typing:

Python is dynamically typed, meaning the type of a variable is interpreted at runtime based on the variable’s value. This flexibility is common in interpreted languages.

  • Ease of Debugging:

Since Python code is executed line-by-line, it’s easier to identify and fix errors. The interpreter can provide immediate feedback, making debugging more straightforward.

  • Portability:

Python’s bytecode is platform-independent, allowing the same Python program to run on different operating systems without modification. The interpreter abstracts away the underlying hardware details.

  • Development Speed:

Without the need for a separate compilation step, Python allows for rapid development and testing. Developers can quickly iterate on their code, making changes and seeing results immediately.

Comparison with Compiled Languages:

In compiled languages like C or C++, the source code is translated into machine code by a compiler before it is run. This machine code is specific to the processor and operating system, making it non-portable. The compilation process can also be time-consuming, as it needs to be done before the program can be executed.

What is Python and why is it popular?

Python is a high-level, interpreted programming language known for its simplicity and readability. Created by Guido van Rossum and first released in 1991, Python’s design philosophy emphasizes code readability and simplicity, making it an ideal language for both beginners and experienced developers.

Key Features of Python:

  • Readability and Simplicity:

Python’s syntax is clean and easy to understand, resembling plain English. This simplicity allows developers to write clear and logical code for both small and large-scale projects.

  • Versatility:

Python is a versatile language that supports multiple programming paradigms, including procedural, object-oriented, and functional programming. This flexibility makes it suitable for a wide range of applications.

  • Extensive Libraries and Frameworks:

Python boasts a vast standard library and numerous third-party libraries and frameworks, such as NumPy and pandas for data analysis, Django and Flask for web development, and TensorFlow and PyTorch for machine learning. These resources enable developers to efficiently build and deploy applications.

  • Community and Support:

Python has a large and active community. This community-driven support results in extensive documentation, tutorials, and forums, providing valuable resources for learning and troubleshooting.

  • Cross-Platform Compatibility:

Python is platform-independent, meaning it can run on various operating systems such as Windows, macOS, and Linux without requiring modifications to the code. This compatibility is a significant advantage for developers working in diverse environments.

Why Python is Popular:

  • Ease of Learning:

Python’s straightforward syntax and readability lower the barrier to entry for beginners. Novice programmers can quickly pick up the language and start writing useful code.

  • Rapid Development:

Python’s concise syntax and rich libraries facilitate rapid development and prototyping. Developers can implement and iterate on ideas more quickly compared to other languages.

  • Wide Range of Applications:

Python’s versatility allows it to be used in various domains, including web development, data science, artificial intelligence, scientific computing, automation, and more. This broad applicability attracts a diverse group of developers.

  • Strong Community and Ecosystem:

The active Python community continuously contributes to its growth by developing new libraries, tools, and frameworks. This ecosystem ensures that Python remains relevant and up-to-date with the latest technological advancements.

  • Industry Adoption:

Major companies such as Google, Facebook, NASA, and Netflix use Python for various applications, endorsing its reliability and efficiency. This industry adoption further boosts Python’s popularity and credibility.

Business Mathematics & Statistics Bangalore University B.com 3rd Semester NEP Notes

Unit 1 Commercial Arithmetic [Book]
Percentage VIEW
Cost, Profit and Selling price VIEW
Ratio Proportion VIEW
Problems on Speed and Time VIEW
Interest-Simple interest and Compound interest VIEW
Annuity VIEW

 

Unit 2 Theory of Equations [Book] No Update

 

Unit 3 Matrices and Determinants [Book] No Update

 

Unit 4 Measures of Central Tendency and Dispersion [Book]
Introduction Meaning and Definition, Objectives of measures of Central tendency VIEW
Types of averages: Arithmetic mean (Simple average only) VIEW
Median VIEW
Mode VIEW
Meaning and Objectives of measures of Dispersion VIEW
VIEW VIEW
Standard deviation and coefficient of Variation VIEW
Skewness VIEW VIEW
Problems on Direct method only VIEW

 

Unit 5 Correlation and Regression [Book]
Correlation: Meaning and definition-uses VIEW VIEW
VIEW
Karl Pearson’s coefficient of correlation (deviation from actual mean only) VIEW
Spearman’s Rank Correlation Coefficient VIEW
Regression Meaning VIEW
Regression Equations, Estimating x and y values VIEW
Finding correlation coefficient with Regression coefficient VIEW VIEW

Calculation of Interest

Calculating interest rate is not at all a difficult method to understand. Knowing to calculate interest rate can solve a lot of wages problems and save money while taking investment decisions. There is an easy formula to calculate simple interest rates. If you are aware of your loan and interest amount you can pay, you can do the largest interest rate calculation for yourself.

Using the simple interest calculation formula, you can also see your interest payments in a year and calculate your annual percentage rate.

Here is the step by step guide to calculate the interest rate.

How to calculate interest rate?

Know the formula which can help you to calculate your interest rate.

Step 1

To calculate your interest rate, you need to know the interest formula I/Pt = r to get your rate. Here,

I = Interest amount paid in a specific time period (month, year etc.)

P = Principle amount (the money before interest)

t = Time period involved

r = Interest rate in decimal

You should remember this equation to calculate your basic interest rate.

Step 2

Once you put all the values required to calculate your interest rate, you will get your interest rate in decimal. Now, you need to convert the interest rate you got by multiplying it by 100. For example, a decimal like .11 will not help much while figuring out your interest rate. So, if you want to find your interest rate for .11, you have to multiply .11 with 100 (.11 x 100).

For this case, your interest rate will be (.11 x 100 = 11) 11%.

Step 3

Apart from this, you can also calculate your time period involved, principal amount and interest amount paid in a specific time period if you have other inputs available with you.

Calculate interest amount paid in a specific time period, I = Prt.

Calculate the principal amount, P = I/rt.

Calculate time period involved t = I/Pr.

Step 4

Most importantly, you have to make sure that your time period and interest rate are following the same parameter.

For example, on a loan, you want to find your monthly interest rate after one year. In this case, if you put t = 1, you will get the final interest rate as the interest rate per year. Whereas, if you want the monthly interest rate, you have to put the correct amount of time elapsed. Here, you can consider the time period like 12 months.

Please remember, your time period should be the same time amount as the interest paid. For example, if you’re calculating a year’s monthly interest payments then, it can be considered you’ve made 12 payments.

Also, you have to make sure that you check the time period (weekly, monthly, yearly etc.) when your interest is calculated with your bank.

Step 5

You can rely on online calculators to get interest rates for complex loans, such as mortgages. You should also know the interest rate of your loan when you sign up for it.

For fluctuating rates, sometimes it becomes difficult to determine what a certain rate means. So, it is better to use free online calculators by searching “variable APR interest calculator”, “mortgage interest calculator” etc.

Calculation of interest when rate of interest and cash price is given

  • Where Cash Price, Interest Rate and Instalment are Given:

Illustration:

On 1st January 2003, A bought a television from a seller under Hire Purchase System, the cash price of which being Rs 10.450 as per the following terms:

(a) Rs 3,000 to be paid on signing the agreement.

(b) Balance to be paid in three equal installments of Rs 3,000 at the end of each year,

(c) The rate of interest charged by the seller is 10% per annum.

You are required to calculate the interest paid by the buyer to the seller each year.

Solution:

Note:

  1. there is no time gap between the signing of the agreement and the cash down payment of Rs 3,000 (1.1.2003). Hence no interest is calculated. The entire amount goes to reduce the cash price.
  2. The interest in the last installment is taken at the differential figure of Rs 285.50 (3,000 – 2,714.50).

(2) Where Cash Price and Installments are Given but Rate of Interest is Omitted:

Where the rate of interest is not given and only the cash price and the total payments under hire purchase installments are given, then the total interest paid is the difference between the cash price of the asset and the total amount paid as per the agreement. This interest amount is apportioned in the ratio of amount outstanding at the end of each period.

Illustration:

Mr. A bought a machine under hire purchase agreement, the cash price of the machine being Rs 18,000. As per the terms, the buyer has to pay Rs 4,000 on signing the agreement and the balance in four installments of Rs 4,000 each, payable at the end of each year. Calculate the interest chargeable at the end of each year.

(3) Where installments and Rate of Interest are Given but Cash Value of the Asset is Omitted:

In certain problems, the cash price is not given. It is necessary that we must first find out the cash price and interest included in the installments. The asset account is to be debited with the actual price of the asset. Under such situations, i.e. in the absence of cash price, the interest is calculated from the last year.

It may be noted that the amount of interest goes on increasing from 3rd year to 2nd year, 2nd year to 1st year. Since the interest is included in the installments and by knowing the rate of interest, we can find out the cash price.

Thus:

Let the cash price outstanding be: Rs 100

Interest @ 10% on Rs 100 for a year: Rs 10

Installment paid at the end of the year 110

The interest on installment price = 10/110 or 1/11 as a ratio.

Illustration:

I buy a television on Hire Purchase System.

The terms of payment are as follows:

Rs 2,000 to be paid on signing the agreement;

Rs 2,800 at the end of the first year;

Rs 2,600 at the end of the second year;

Rs 2,400 at the end of the third year;

Rs 2,200 at the end of the fourth year.

If interest is charged at the rate of 10% p.a., what was the cash value of the television?

Solution:

(4) Calculation of Cash Price when Reference to Annuity Table, the Rate of Interest and Installments are Given:

Sometimes in the problem a reference to annuity table wherein present value of the annuity for a number of years at a certain rate of interest is given. In such cases the cash price is calculated by multiplying the amount of installment and adding the product to the initial payment.

Illustration:

A agrees to purchase a machine from a seller under Hire Purchase System by annual installment of Rs 10,000 over a period of 5 years. The seller charges interest at 4% p.a. on yearly balance.

N.B. The present value of Re 1 p.a. for five years at 4% is Rs 4.4518. Find out the cash price of the machine.

Solution:

Installment Re 1 Present value = Rs 4.4518

Installment = Rs 10,000 Present value = Rs 4.4518 x 10,000 = Rs 44,518

Credit: https://www.yourarticlelibrary.com/accounting/hire-purchase/how-to-calculate-interest-4-cases-hire-purchase/51175

Quantitative Methods for Business – 1

Unit 1 Number System {Book}

Natural Numbers, Even Numbers, Odd Numbers

VIEW

Integers, Prime Numbers

VIEW

Rational & Irrational numbers

VIEW

Real Numbers, HCF & LCM (Simple Problems)

VIEW

Unit 2 Theory Of Equations {Book}

Please refer Books for this Unit

VIEW

Unit 3 Progressions {Book}

Arithmetic Progression Finding the “n”th term of AP and Sum to “n”th term of AP.

VIEW

Insertion of Arithmetic Mean

VIEW

Geometric Progression Finding the “n”th term of GP and

VIEW

Insertion of Geometric Mean

VIEW

Unit 4 Matrices and Determinants {Book}

Please refer Books for this Unit

VIEW

Unit 4 Commercial Arithmetic {Book}

Simple Interest, Compound Interest including half yearly and quarterly calculations

VIEW

Annuities

VIEW

Percentages

VIEW

Bills Discounting

VIEW

Ratios and proportions

VIEW

Duplicate: Triplicate and Sub-duplicate of a ratio

VIEW

Proportions: Third, Fourth and inverse proportion

VIEW

Unit 5 Progressions {Book}

Arithmetic Progression Finding the “n”th term of AP and Sum to “n”th term of AP.

VIEW

Insertion of Arithmetic Mean

VIEW

Geometric Progression Finding the “n”th term of GP and

VIEW

Insertion of Geometric Mean

VIEW

Determinants of the Value of Bonds

Bonds are fixed-income securities that represent a loan from an investor to a borrower, typically a corporation or government. When purchasing a bond, the investor lends money in exchange for periodic interest payments and the return of the bond’s face value at maturity. Bonds are used to finance various projects and operations, providing a predictable income stream for investors.

Valuation of Bonds

The method for valuation of bonds involves three steps as follows:

Step 1: Estimate the expected cash flows

Step 2: Determine the appropriate interest rate that should be used to discount the cash flows.

& Step 3: Calculate the present value of the expected cash flows (step-1) using appropriate interest rate (step- 2) i.e. discounting the expected cash flows

Step 1: Estimating cash flows

Cash flow is the cash that is estimated to be received in future from investment in a bond. There are only two types of cash flows that can be received from investment in bonds i.e. coupon payments and principal payment at maturity.

The usual cash flow cycle of the bond is coupon payments are received at regular intervals as per the bond agreement, and final coupon plus principle payment is received at the maturity. There are some instances when bonds don’t follow these regular patterns. Unusual patterns maybe a result of the different type of bond such as zero-coupon bonds, in which there are no coupon payments. Considering such factors, it is important for an analyst to estimate accurate cash flow for the purpose of bond valuation.

Step 2: Determine the appropriate interest rate to discount the cash flows

Once the cash flow for the bond is estimated, the next step is to determine the appropriate interest rate to discount cash flows. The minimum interest rate that an investor should require is the interest available in the marketplace for default-free cash flow. Default-free cash flows are cash flows from debt security which are completely safe and has zero chances default. Such securities are usually issued by the central bank of a country, for example, in the USA it is bonds by U.S. Treasury Security.

Consider a situation where an investor wants to invest in bonds. If he is considering to invest corporate bonds, he is expecting to earn higher return from these corporate bonds compared to rate of returns of U.S. Treasury Security bonds. This is because chances are that a corporate bond might default, whereas the U.S. Security Treasury bond is never going to default. As he is taking a higher risk by investing in corporate bonds, he expects a higher return.

One may use single interest rate or multiple interest rates for valuation.

Step 3: Discounting the expected cash flows

Now that we already have values of expected future cash flows and interest rate used to discount the cash flow, it is time to find the present value of cash flows. Present Value of a cash flow is the amount of money that must be invested today to generate a specific future value. The present value of a cash flow is more commonly known as discounted value.

The present value of a cash flow depends on two determinants:

  • When a cash flow will be received i.e. timing of a cash flow &;
  • The required interest rate, more widely known as Discount Rate (rate as per Step-2)

First, we calculate the present value of each expected cash flow. Then we add all the individual present values and the resultant sum is the value of the bond.

The formula to find the present value of one cash flow is:

Present value formula for Bond Valuation

Present Value n = Expected cash flow in the period n/ (1+i) n

Here,

i = rate of return/discount rate on bond
n = expected time to receive the cash flow

By this formula, we will get the present value of each individual cash flow t years from now. The next step is to add all individual cash flows.

Bond Value = Present Value 1 + Present Value 2 + ……. + Present Value n

error: Content is protected !!