0% found this document useful (0 votes)
11 views5 pages

3.2-Algorithims and Code

Uploaded by

elsachoueiry2007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

3.2-Algorithims and Code

Uploaded by

elsachoueiry2007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Algorithm-is a step-by-step set of procedures used to solve a problem or perform a

specific activity or Algorithms define a set of instructions that will be carried out in a
specific order, to obtain an intended output.

Characteristics of an algorithm-
Unambiguous: Algorithms should be clear and concise; the inputs and outputs should
be clear and all steps of the procedure explicit.
Finite: Algorithms must have a finite number Of Steps that end once they have been
completed.The algorithm must stop eventually with either the expected output or a
response that indicates that there is no solution.
Well defined: Each step of the procedure should be well defined, making very specific
the steps to be taken and in what order. Details of each step must be explicit, including
how to handle any errors.
Inputs. The input is the data, which Will be transformed by the procedure. An algorithm
may have zero or more inputs.
Outputs: The output is the data that has been transformed by the process: it should
match the desired OUtPUt. An algorithm should have one or more well-defined outputs.
Feasible: For an algorithm to be effective, the procedure must be possible with the
available resources and not contain any redundant unnecessary steps.
Independent: The algorithm should have step-by-step instructions and be independent
of any programming language.

Components of an algorithm-
Instructions: An algorithm consists of a sense of sub-algorithms, each
performing a small activity. Each set of steps for a small activity IS called an
instruction. One example would be digit addition.
Variables: You may have come across variables in mathematical problem-
solving or science experiments. They have the same function here in
an algorithm, which IS to temporarily store values while the steps of the
algorithms are being executed. As the algorithm is being processed line by line.
the variable will change value, hence its name. For example, an algorithm
used to calculate profit will have the variable named 'profit' to store this data.
Conditionals: One of the steps in an algorithm could be to make a decision or choice.
An example of this is when an algorithm is required to determine whether a profit has
been made. This could be written as: if Sales > Costs, then print 'We are profitable'
Loops: Algorithms would be very limited if they could only run a sequence of steps
once. Which is why many algorithms contain loops. Loops allow a set of instructions to
repeat when a certain condition is met. For example, an algorithm may repeat until there
are no more customers.
Ways of representing data-
● Natural language is a popular choice and may often be considered the first step
of designing a computer program.Using everyday language allows developers to
work with non-coders to write down the steps that the algorithm needs to follow,
with the advantage that everyone involved is able to understand the process. It
can be ambiguous and lack clarity
● Flowchart: A visual representation of an algorithm showing an overview from
start to end. Flowcharts use a standard set of symbols to represent the different
components, and arrows are used to show the direction of the steps.
● Programming languages-Once an algorithm has been planned, it is time to
start writing the code so that the program can be tested and implemented.There
have been many programming languages created throughout history, It is not
just the language (English) used in the code that is important, however, but also
the language of the community of programmers. According To the TIOBE Index
2022, Python is the most popular programming language, followed by C, Java
and C++

Uses of algorithms-
● Whether they are processed by mathematicians, scientists or computer
scientists, algorithms often perform the same common tasks. Take, for example.
the bubble sort algorithm learned by computer science students. This is one of
the most basic sorting algorithms, which runs in a loop and swaps adjacent
elements until they are in the correct order. Alternatively, sorting may be found as
a built-in function in a spreadsheet or database.
● Algorithms may also be used for searching (which may be referred to as a
'query' in a database), filtering (with the selection of cells based on certain
criteria) and counting. For example, a scientist may use a spreadsheet to analyze
the results of an experiment. To do this they may sort the results to find the
highest or lowest values, or filter the spreadsheet for a specific variable to narrow
down their results, or count how many instances a given value appears in their
results. Alternatively, the scientist may use an open- access research database
to search for results of similar laboratory investigations

Prioritization algorithm: A sorting algorithm used to prioritize tasks.

Association rule: Uncovers how items are associated with each other and reveals
relationships between items in large databases.
Algorithmic dilemmas-Algorithmic dilemmas are ethical and moral challenges that
arise when designing or implementing algorithms. These dilemmas may arise due to
conflicts between different ethical principles, such as fairness, privacy, accountability,
and accuracy, or due to unintended consequences of algorithmic decision-making.

Algorithmic bias:
● Human algorithm developers unknowingly introduce bias into their models.
● The training data set includes biased data or is incomplete, so it is not a true
representation of the population.

Black box algorithm: An algorithm that provides insight without clarity on how the
conclusions were reached from the data input.

Transparency in algorithms: the ability to understand and be able to explain the inner
workings of the algorithm.

How the decisions done by AI through industries like healthcare and financial
services can be problematic and blame the people behind the algorithms?
Ans:
● it is often difficult to explain how the algorithm reached its conclusion
● it is not always possible to know how the training data was selected
● The evolving nature of machine learning makes it difficult to keep up.

REAL-WORLD EXAMPLE
Search algorithms: PageRank
Google's search algorithm PageRank is one of the most frequently used search
algorithms to find the most relevant web pages for a given search criteria There are
many sub-algorithms in this search algorithm that look at factors such as the words
used in the query,expertise of sources, quality of content, location and useability of web
pages.
Machine learning algorithms and facial recognition
According to American Scientist, machine learning algorithms are being used to link
physical appearance with other traits, many of which are reportedly making false claims.
In one example, an algorithm was used to determine personality traits of job candidates
based on their facial expressions. In another, machine learning was used to determine if
a person was cheating in an online examination based on how their face changed as
they answered the questions. One notorious misuse of facial recognition was an
algorithm that claimed to identify a criminal based on the shape of their face with an
accuracy of 89.5%!

Algorithm day to day applications-


Algorithms are all around us, aiding us with online searching and shopping. Small
businesses can gain new insights into trends when making sales forecasts without
having to hire experts, which ultimately allows them to provide a better service for
customers and employ the right staff. Governments can analyze health data to
improve hospital services and use artificial intelligence in the courtroom.

Algorithms used by the police and courts


In 2020 the Harvard Gazette reported on the use of algorithms by the US government.
There were approximately 2.2 million adults in prison in the US in 2016. With increased
pressure to reduce these numbers,police departments used predictive algorithms to
help decide where to locate police personnel on the streets. At the same time,
courtrooms were using criminal risk assessment algorithms to determine the length of
prison sentences. This algorithm created a score for each defendant based on their
profile and likelihood of reoffending. However, criminals from Iow-income and minority
communities were at risk of having higher scores because historically they came from
areas With a disproportionately higher number of court cases. This led to less-favorable
sentencing. In a different case, one court sentenced a man to 18 months in jail because
the algorithm placed a greater weighting on his age. If he had been older, he would
have had a much shorter sentence.

Bias in algorithms
A study published in 2020 found that the algorithm used to determine the health of a
The patient's kidney function used race as one of the factors. Of the 57,000 medical
records reviewed in Massachusetts, one-third of the black patients would have had their
disease classified as more severe if the formula used for white patients had been
applied.
Black box algorithms: Object detection systems in autonomous vehicles
'Predictive inequity in object detection', an academic paper written by a group of
researchers at the Georgia Institute of Technology, highlighted that the deep learning
a computer vision model found it difficult to detect people with dark skin. If used in
autonomous vehicles, it would unlikely detect a pedestrian crossing the road if they had
darker skin. Due to the nature of the black box algorithms, it made it much harder for
developers to go back and correct the algorithm.

Black box algorithms: Deep Patient software


In 2015, a research group trained their Deep Patient software to discover patterns
hidden
in hospital data to predict if a patient was likely to develop medical problems. It was
particularly good at predicting psychiatric disorders, which were often difficult for human
doctors to foresee. However, because of its black box nature and lack of transparency,
doctors were very resistant to using it.

You might also like