DFDs and Algorithms
DFDs and Algorithms
• Data Flow Diagrams are used as a method of expressing a system at any degree
of detail using a visual network of symbols that depicts data flows, data
storage, data processes, and data sources/destinations.
• The goal of data flow diagrams is to serve as a semantic link between users and
system engineers.
What is a Data Flow Diagram?
• Other structured systems analysis tools, such as data structure diagrams, data
dictionaries, and procedure-representing approaches such as decision tables,
decision trees, and structured English, supplement data flow diagrams.
What is a Data Flow Diagram?
DFD Symbols – External Entity
External Entity
• It represents sources of data to the system or
destinations of data from the system.
• It is customary for all the information represented within a system to have come
from and/or been passed on to an external source or receiver.
• These external entities can be replicated on a diagram to prevent data flow lines
from crossing.
• A stripe is painted across the left-hand corner when they are repeated.
• The process symbol represents an activity that transforms or manipulates the data.
• The first thing that displays is an identifying number in the upper left-hand corner.
• This is assigned at the top level randomly and serves as a unique reference.
DFD Symbols – Process
• Second, a location displays to the right of the identifier and explains where
the process occurs in the system. This might be a department or a piece of
hardware.
Process
DFD Symbols – Process
• When identifying processes, avoid glossing over them without fully comprehending their
significance.
• The inclusion of ambiguous phrases in the descriptive title box, such as 'process' or 'update,'
is an indication that this has occurred.
• The most important thing to remember is that the description must make sense to the
person who will be utilizing the diagram.
DFD Symbols – Process
• Data Flow double headed arrows can be used (to show two-way flows) on all but bottom
level diagrams.
• Furthermore, like most other symbols, a data flow at a certain level of a diagram can be
dissected into several data flows at lower levels.
• Data Storage Facilities each store should be assigned a letter followed by an arbitrary
number.
DFD Symbols – Data Flow
• Data stores can be long-term files, such as sales ledgers, or they can
be short-term accumulations, such as batches of papers waiting to be
processed.
• Each data store should be assigned a unique reference followed by an Data Store
arbitrary number.
DFD Symbols – Resource Flow
• A resource flow depicts the movement of any physical material from its origin
to its destination.
• Resource flows are often limited to early, high-level diagrams and are
employed when a depiction of the actual movement of materials is thought to
be significant to the study.
DFD Procedure
1. Identify and list external entities that provide inputs to/receive outputs from the system.
3. Draw a context diagram with the system in the middle and other entities transmitting and
receiving data flows
4. Identify the business functions that fall within the scope of the system
6. Certify receipt of data supplied via personal contact and vice versa
7. Monitor and record what occurs to each data flow that enters the system (data transfer,
data storage, data transformation/processing).
• To ensure system control, the external entity's input may need to be dictated.
Customers, for example, may be required to submit purchases or refund requests
including specified information, which may need the use of a system to assist in the
completion of a form.
DFD - Things to Keep In Mind
• When in doubt, incorporate the external entity as a process within the system and
then assess with those involved.
DFD - Things to Keep In Mind
• If you're having problems categorizing anything on the diagram, it's probably because
you don't understand it well enough.
• Including "when," "where," and "how" indicates that you are getting physical.
DFD - Things to Keep In Mind
• A data flow diagram is not a flowchart and should not include loops or control
transfers.
• Consider the data flows, methods, and storage required to move a data structure
through a system.
DFD - Things to Keep In Mind
• The index/outline will be "fleshed out" in the data dictionary, data structure
diagrams, and procedure specification techniques.
Algorithms for Problem-Solving
Learning Objective 7
Problem Solving
• Every time they are conducted, they provide the same desired result.
Algorithms for Problem Solving
• Algorithms are widely employed in our daily lives, particularly in computer science.
• When you conduct an Internet search, search engines such as Google utilize
algorithms to determine which entries will display first in your list of results.
• Facebook also uses algorithms to determine which posts appear on your newsfeed.
Characteristics of a Good Algorithm
Learning Objective 8
Characteristics of A Good Algorithm
• You should consider input as the data needed to begin to get the desired result
• Input precision requires that you know what kind of data, how much and what form
the data should be
Specified Output
• An algorithm should have 1 or more well-defined outputs, and should match the desired
output.
• Often, the name of the algorithm gives you an idea of the output. For example, “Algorithm
to compute batting average” lets us know that the output would be the batting average.
• Output precision requires that you know what kind of data, how much and the form the
output should be in (or even if there will be any output)
Definite
• Algorithms must be specific in identifying or specifying every step and the order
the steps should be taken in
• Details of each step should be specified as well. For example, error handling
Effective
• For an algorithm to be effective, the steps required to get the desired output
must be doable.
• For an algorithm to be effective, it means that all those steps that are required
to get to output must be feasible with the available resources.
• It should not contain any unnecessary and redundant steps which could make an
algorithm ineffective.
Finite
• Stopping may mean that you get the expected output, or you get a response
indicating that no solution can be achieved
• Computer algorithms often repeat instructions with different data and as such
finiteness is a potential issue
Other Characteristics of Algorithms
Algorithms should:
• Be general and applicable to several cases
• Use resources efficiently (quick speed and use minimal RAM/Disk space)
• It can be written in basic English, although this style has several disadvantages.
• Natural language can be ambiguous and hence lacks the quality of being definite.
• Each step of an algorithm should be explicit and have only one meaning.
• English-like algorithms are not thought to be suitable for the majority of activities.
Flowcharts
• They are easy to understand and are commonly used in the case of simple problems.
Flowcharts
Flowcharts
Pseudocode
• Pseudocode is an informal way of programming description that does not require any strict
programming language syntax or underlying technology.
• Pseudocode has an advantage of being easily converted into any programming language.
• This way of writing algorithm is most acceptable and most widely used.
• In order to write a pseudocode, one must be familiar with the conventions of writing it.
Pseudocode – Format
• The boolean expression 'x > y' returns true if x is greater than y, else returns false.
• The boolean expression 'x < y' returns true if x is less than y, else returns false.
• The boolean expression 'x <= y' returns true if x is less than or equal to y, else
returns false.
Pseudocode – Format
• The boolean expression 'x >= y' returns true if x is greater than or equal to y, else returns false.
• The boolean expression 'x != y' returns true if x is not equal to y, else returns false.
• The boolean expression 'x == y' returns true if x is equal to y, else returns false.
• The boolean expression 'x AND y' returns true if both conditions are true, else returns false.
• The boolean expression 'x OR y' returns true if any of the conditions is true, else returns false.
• The boolean expression 'NOT y' returns true if the result of x evaluates to false, else returns false.
Pseudocode – Format
• This condition is an enhancement of the above 'if' statement. It can also handle the case
where the condition isn't satisfied.
if< condition >then< statement1 >else< statement2 >
Pseudocode – Format
• while loop
while< condition >do { statements }
• do-while loop
repeat statements until< condition >
Pseudocode – Format
• for loop
for variable = value1 to value2 { statements }
• input instruction
Read
• Output instruction
Print
Pseudocode – Format
• The name of the algorithm is < name > and the arguments are stored in the < parameter list >
Algorithm< name > (< parameter list >)
Objectives 6 – 9 Complete!
Learning Objective 6
SOURCES
• https://course.oeru.org/ipsy102/learning-pathways/cognition-language-and-problem-
solving/problem-solving-strategies/
• http://sofia.cs.vt.edu/cs1114-ebooklet/chapter4.html
• https://www.igi-global.com/dictionary/algorithms-aided-sustainable-urban-design/988 ·
• https://course.oeru.org/ipsy102/learning-pathways/cognition-language-and-problem-
solving/problem-solving-strategies/
• https://dev.to/yogeswaran79/ways-of-writing-an-algorithm-2io3