Category Archives: Theory

A Brief History of AI

Artificial Intelligence (AI) has a rich history that spans several decades, marked by periods of excitement and significant breakthroughs as well as phases of skepticism and setbacks. Understanding this history provides valuable context for the advancements we see in AI today.

The Origins of AI

1. The Birth of AI (1940s-1950s)

  • 1943: Warren McCulloch and Walter Pitts proposed a model of artificial neurons. This work laid the groundwork for neural networks.
  • 1950: Alan Turing published “Computing Machinery and Intelligence,” introducing the concept of the Turing Test to assess a machine’s ability to exhibit intelligent behavior equivalent to, or indistinguishable from, that of a human.
  • 1956: The term “Artificial Intelligence” was coined by John McCarthy during the Dartmouth Conference, which is considered the birth of AI as a field of study. The conference brought together researchers interested in automating aspects of human intelligence.
John McCarthy, one of the founders of AI, at the Dartmouth Conference, 1956

John McCarthy, one of the founders of AI, at the Dartmouth Conference, 1956.

The Early Years and AI Winter

2. The Early Enthusiasm (1950s-1960s)

  • Late 1950s-1960s: Early AI programs were developed, such as the Logic Theorist by Allen Newell and Herbert A. Simon, which mimicked human problem-solving skills, and ELIZA by Joseph Weizenbaum, an early natural language processing program.
  • 1966: Shakey the Robot, developed at Stanford, was the first robot to integrate AI for perception and navigation.

3. The First AI Winter (1970s)

  • 1970s: Despite early successes, AI research faced significant challenges. Systems were limited by the computational power of the time, and many ambitious projects failed to meet expectations. Funding decreased, leading to the first AI winter, a period of reduced AI research and development activity.

Revival and Modern AI

4. The Expert Systems Boom (1980s)

  • 1980s: AI research revived with the development of expert systems, which mimicked the decision-making abilities of human experts. Systems like MYCIN, which diagnosed bacterial infections, showed practical applications of AI.
  • 1987-1993: The boom was followed by another AI winter due to high costs and limited capabilities of expert systems compared to the rising expectations.

5. Machine Learning and Big Data (1990s-2000s)

  • 1990s: The advent of more powerful computers and increased data availability helped AI research progress. Machine learning, a subset of AI focusing on algorithms that improve through experience, gained prominence.
  • 1997: IBM’s Deep Blue defeated world chess champion Garry Kasparov, showcasing the potential of AI.
Garry Kasparov playing against IBM's Deep Blue, 1997

Garry Kasparov playing against IBM’s Deep Blue, 1997.

6. The Rise of Deep Learning (2010s-Present)

  • 2010s: Advances in neural networks, particularly deep learning, revolutionized AI. Algorithms such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs) enabled significant improvements in image and speech recognition.
  • 2012: Google’s DeepMind developed AlphaGo, which defeated the world champion Go player, demonstrating AI’s capabilities in complex problem-solving and learning.
  • 2010s-Present: AI has seen widespread adoption across various industries, from healthcare to finance, and significant improvements in natural language processing (e.g., GPT-3), autonomous vehicles, and more.
AlphaGo vs. Lee Sedol, 2016

AlphaGo vs. Lee Sedol, 2016.

Conclusion

The journey of AI is marked by alternating periods of rapid advancement and challenging setbacks. From the theoretical foundations laid in the 1940s to the transformative deep learning breakthroughs of today, AI has evolved into a powerful and integral part of modern technology. Understanding this history helps appreciate the progress made and the potential future developments in this exciting field.

What is Artificial Intelligence?

Artificial Intelligence (AI) is a branch of computer science that focuses on creating systems capable of performing tasks that typically require human intelligence. These tasks include problem-solving, learning, planning, understanding natural language, recognizing patterns, and making decisions.

Key Components of AI

  1. Machine Learning: A subset of AI that involves training algorithms on data to make predictions or decisions without being explicitly programmed to perform the task.
  2. Deep Learning: A subset of machine learning that uses neural networks with many layers (hence “deep”) to analyze various factors of data.
  3. Natural Language Processing (NLP): The ability of a computer program to understand and process human language.
  4. Computer Vision: Enabling computers to interpret and make decisions based on visual inputs from the world.

Types of AI

  1. Narrow AI (Weak AI): AI systems designed and trained for a specific task. Examples include virtual assistants like Siri and Alexa, recommendation systems on Netflix and Amazon, and self-driving cars.
  2. General AI (Strong AI): A theoretical form of AI where machines possess the ability to perform any intellectual task that a human can do. This type of AI would have the ability to understand, learn, and apply knowledge in different contexts.
  3. Superintelligent AI: An even more advanced form of AI that surpasses human intelligence across all fields. This is currently a hypothetical concept.

How AI Works

AI systems work by combining large amounts of data with fast, iterative processing and intelligent algorithms. This allows the software to learn from patterns or features in the data. AI processes include:

  1. Learning: Acquiring data and creating rules for how to turn the data into actionable information. The rules, called algorithms, provide the AI with step-by-step instructions for how to complete a specific task.
  2. Reasoning: Choosing the right algorithm to achieve the desired outcome.
  3. Self-Correction: Continuously fine-tuning algorithms to ensure the most accurate results possible.
  4. Natural Language Processing: Understanding human language as it is spoken and written.

Real-World Examples of AI

  1. Virtual Assistants: Siri, Google Assistant, and Alexa use AI to interpret voice commands and provide appropriate responses.
  2. Recommendation Systems: Netflix and Amazon use AI to recommend shows, movies, and products based on user preferences and behaviors.
  3. Healthcare: AI is used to analyze medical images, predict patient outcomes, and personalize treatment plans.
  4. Finance: AI algorithms are used for fraud detection, algorithmic trading, and credit scoring.
  5. Autonomous Vehicles: Companies like Tesla and Waymo use AI to develop self-driving cars that can navigate complex environments.

Example with Image

Consider the example of AI in self-driving cars:

Self-driving cars use AI to navigate, recognize traffic signs, and avoid obstacles.

Self-driving cars utilize various AI components:

  • Computer Vision: Cameras and sensors detect and interpret the car’s surroundings, such as recognizing traffic lights, pedestrians, and other vehicles.
  • Machine Learning: Algorithms process data from these sensors to make decisions, like when to stop or turn.
  • Deep Learning: More advanced self-driving systems use deep learning to improve their ability to understand complex scenarios and improve over time.

Conclusion

Artificial Intelligence is revolutionizing various aspects of our lives by enabling machines to perform tasks that once required human intelligence. From virtual assistants to self-driving cars, AI is transforming industries and creating new possibilities for the future. As technology advances, the potential applications and benefits of AI will continue to grow, making it an exciting field to watch and explore.


This explanation provides a broad overview of AI, its components, types, workings, and real-world applications, making it accessible to readers who may be new to the subject. The included image example of a self-driving car illustrates one of the many practical applications of AI today.

PHP Arrays

php-array

An array stores multiple values/data/string in an single variable.

<?php
$name = array("Vijay","Gopi","Edwin","Munee");
echo "Members are ".$name[0].",".$name[1].",".$name[2].",".$name[3];

?> 

Output: Members are Vijay,Gopi,Edwin,Munee

Array Definition:

An array is an special variable which holds more than one / multiple variable at a time.

If you have a list of data, storing the names should be could look like this

$name1 = 'Vijay';
$name2 = 'Gopi';
$name3 = 'Edwin';
$name4 = 'Munee';

If you have more number of data, example more than 10 members in a team we can use array instead of creating 10 different variable.

Creation of Array

In PHP the array will create using array() function.

There are three types of arrays are there in PHP.

  • Indexed Array ( Array with numeric index )
  • Associative Array ( Array with named key )
  • Multidimensional Array ( Array containing multiple arrays with in it )

Indexed Array

An array with numeric index is called Indexed array

<?php
$a = array("IND","US","AUS");
echo $a[0]."<br />";
echo $a[1]."<br />";
echo $a[2]."<br />";
?>

Output:
IND
US
AUS

Associative Array

An array with named key is call as Associative array

<?php
$a = array("India"=>"IND","United States"=>"US","Australia"=>"AUS");
echo $a['India']."<br />";
echo $a['United States']."<br />";
echo $a['Australia']."<br />";
?>

Output:
IND
US
AUS

Multidimensional Array

An array containing multiple array with in it called as Multidimensional .

<?php
$a = array("India"=>array("KA","TN","KL"),"United States"=>array("AL","AK","AZ"));
?>

PHP Function

Functions are used to reduce the repetition of codes in your scripts.

The user define function are starts with function tag.

The function name should not start with numbers ( 0 – 9 ). The allowed format is letters ( a-z, A-Z )  and underscores ( _ ).

Beginning with curly braces (  {  ) indicates the function get start to execute the block of code under the function. Closing curly braces ( } ) indicates the closing / end of the function.

<?php
     function cityDetails($city){
         echo "Am staying in $city";
         echo "<br />";
     }

     cityDetails("New York");
     cityDetails("Los Angeles");
?>

Output:
Am staying in New York
Am staying in Los Angeles
<?php
     function add($a,$b){
       $c = $a + $b;
       return $c;
     }
     function sub($a,$b){
       $c = $a - $b;
       return $c;
     }
     function mul($a,$b){
       $c = $a * $b;
       return $c;
     }

    $addingValues = add(25,15);
    $subtractingValues = sub(30,10);
    $multiplicationValues = mul($addingValues,$subtractingValues);
    echo "Multiplication Value is :: $multiplicationValues";
?>

Output :
Multiplication Value is :: 800

// addition value is 40
// subtraction value is 20
// Multiplication of both the data will be 40 * 20 = 800

For more info please refer php.net functions section.

 

 

PHP Loops

PHP loops are used to execute a certain block of code, while the specific condition is true.

If you want run over / execute  same set  of codes in your page you can use PHP loops.

In PHP we are having 4 different types of looping statement:

  • while
  • do … while
  • for
  • foreach

For your reference below some examples are given.

The PHP while loop:

<?php
$i = 2;
while($i <= 6){
   echo $i."<br />";
   $i++;
}
?>

Output:

2
3
4
5
6

The PHP do…while loop:

<?php 
$i=2; 
do
  {
  echo "The current value is: $i <br>";
  $x++;
  }
while ($i<=4)
?>
Output:

The current value is: 2
The current value is: 3
The current value is: 4

The PHP for loop:

<?php 
for ($i=0; $i<=10; $i++)
  {
  echo "The current value is: $x <br>";
  } 
?>

The PHP foreach loop:

<?php 
$students = array("Jhon","Victor","Ram","Vijay"); 
foreach ($students as $value)
  {
  echo "$value <br>";
  }
?>

PHP Switch statement

The switch statement is similar to if..else statement only.

In many situation, you may need to check / compare different values with the same variable. In that situation switch statement really helps.

Switch case is bit faster compare with series of if statement.

<?php
$x = "announcement";
switch ($x) {
    case "login":
        echo "You are entered in Login / Signup page";
        break;
    case "home":
        echo "You are entered in Home page";
        break;
    case "announcement":
        echo "You are entered in Announcement page";
        break;
    case "logout":
        echo "You are entered in Logout page";
        break;
    default:
        echo "You are entered in Login / Signup page";
        break;
}
?>
Output:
You are entered in Announcement

Note:

  • break used to prevent the code running from current to next case level.
  • In here you can able to see a special case called default.It is used to define the default value, if no statement match is found in the block segment.

PHP if…else Statements

PHP having different types of conditional statements like C and C ++. Below we listed the conditional statements presents in PHP..

  • if statement
  • if … else statement
  • if … elseif ….. else statement
  • Nested if  statement
  • switch statement

For more information please Click Here.

PHP Constants

constant

A constant is a name/identifier for a simple value. The constant value can not able to change during the time of script execution.

The constants are defined using define() function.

It will return either constant value of NULL.

Two types of constants are there. They are,

  • Case-sensitive constants
  • Case-insensitive constants

Case-sensitive

<?php
define("MAX_SIZE","100");
echo MAX_SIZE;
?>

Output:
100

Case-insensitive

<?php
define("MAX_SIZE","100",true);
echo max_size;
?>

Output:
100

PHP String functions

PHP String Functions PHP strings are sequences of characters, like ” Hello World “. In this chapter we will see the commonly used string functions.

str_len() Function

This function is used get the total number of characters in string .

<?php
echo str_len("Test String");
?>

Output:
11

addslashes() Function

This function will return the string with backslashes in-front of the special character.

<?php
$str_data = addslashes("It's test data");
?>

Output:
It\'s test data

Below mentioned the lists of PHP string function for your reference. The examples for these will be update soon.

  1. addcslashes
  2. addslashes
  3. bin2hex
  4. chop
  5. chr
  6. chunk_split
  7. convert_cyr_string
  8. convert_uudecode
  9. convert_uuencode
  10. count_chars
  11. crc32
  12. crypt
  13. echo
  14. explode
  15. fprintf
  16. get_html_translation_table
  17. hebrev
  18. hebrevc
  19. hex2bin
  20. html_entity_decode
  21. htmlentities
  22. htmlspecialchars_decode
  23. htmlspecialchars
  24. implode
  25. join
  26. lcfirst
  27. levenshtein
  28. localeconv
  29. ltrim
  30. md5_file
  31. md5
  32. metaphone
  33. money_format
  34. nl_langinfo
  35. nl2br
  36. number_format
  37. ord
  38. parse_str
  39. print
  40. printf
  41. quoted_printable_decode
  42. quoted_printable_encode
  43. quotemeta
  44. rtrim
  45. setlocale
  46. sha1_file
  47. sha1
  48. similar_text
  49. soundex
  50. sprintf
  51. sscanf
  52. str_getcsv
  53. str_ireplace
  54. str_pad
  55. str_repeat
  56. str_replace
  57. str_rot13
  58. str_shuffle
  59. str_split
  60. str_word_count
  61. strcasecmp
  62. strchr
  63. strcmp
  64. strcoll
  65. strcspn
  66. strip_tags
  67. stripcslashes
  68. stripos
  69. stripslashes
  70. stristr
  71. strlen
  72. strnatcasecmp
  73. strnatcmp
  74. strncasecmp
  75. strncmp
  76. strpbrk
  77. strpos
  78. strrchr
  79. strrev
  80. strripos
  81. strrpos
  82. strspn
  83. strstr
  84. strtok
  85. strtolower
  86. strtoupper
  87. strtr
  88. substr_compare
  89. substr_count
  90. substr_replace
  91. substr
  92. trim
  93. ucfirst
  94. ucwords
  95. vfprintf
  96. vprintf
  97. vsprintf
  98. wordwrap


 

PHP Data Types

A data type refers to, the type of data/details a variable can store.

PHP has totally eight data types. They are separated  as three major types. They are Scalar , Compound and special types. Below we listed out all the data types.

Scalar Types:

  • Boolean
  • Integer
  • String
  • Float

Compound Types:

  • Object
  • Array

Special Types:

  • NULL
  • Resources

DATA-TYPES

Note: var_dump() will return data type and value of the variable.
Integer:

We can specify integers in three formats.

  • Decimal
  • Hexadecimal
  • Octal
<?php
$a = 345;
$b = -234;
$c = 0x8C;
$d = 047;
var_dump($a);
echo "<br />";
var_dump($b);
echo "<br />";
var_dump($c);
echo "<br />";
var_dump($d);
?>

Output:

int(345)
int(-234)
int(140)
int(39)
 Float :

As we already know Float is a number with decimal point.

<?php
$a = "11.43";
var_dump($a);
$b = "23.5e2";
var_dump($b);
$c = "11e-3";
var_dump($c);
?>

Output:
float(11.43)
float(2350)
float(11.0E-3)
PHP Boolean

The data type Boolean either TRUE or FALSE

<?php
$a = true;
$b = false;
?>
PHP Array

Array is used to store multiple data/value in a single variable.

<?php
$student_role_no = array("12789","12790","12791");
?>
PHP Objects

In PHP an object is used to stores a data/value and information, how to process the data or we can say objects are user define the data type. We will learn more about this in Object oriented program page.

NULL

In PHP NULL is special data type.

Usually we will use this data type to check the variable data is present or empty.  It was assigned as a special constant named as “NULL”.

<?php
$a = "test";
$a = NULL;
?>

Note:Here NULL predefined constant data. So we no need to place it under singe(') or double ("") quotes. If we use unset()function for a variable  its value will get change as NULL.