1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
miskamm [114]
2 years ago
6

Given two objects represented by the tuples (22, 1, 42, 10) and (20, 0, 36, 8):

Computers and Technology
1 answer:
Rudik [331]2 years ago
4 0

Answer:

Given,

P = (22, 1, 42, 10)

Q = (20, 0, 36, 8)

a. Formula for Euclidean Distance :

distance = ((p1-q1)^2 + (p2-q2)^2 + ... + (pn-qn)^2)^(1/2)

Now,

distance = ( (22-20)^2 + (1-0)^2 + (42 - 36)^2 + (10-8)^2) ) ^(1/2)

=( (2)^2 + (1)^2 + (6)^2 + (2)^2 ) ) ^(1/2)

=(4+1+36+4)^(1/2)

=45^(1/2)

Distance = 6.7082

b.Manhattan distance :

d = |x1 - x2| + |y1 - y2|

d = |22- 20| + |1 - 0|

d = |2| + |1|

Explanation:

You might be interested in
1. Write a recursive method to determine if a character is in a list of characters in O(logN) time. Mathematically prove (as we
sergeinik [125]

Answer:

1)

public class BinarySearch {

// Returns index of x if it is present in arr[l..

// r], else return -1

int binarySearch(char arr[], int l, int r, char x)

{

if (r >= l) {

int mid = l + (r - l) / 2;

 

// If the element is present at the

// middle itself

if (arr[mid] == x)

return mid;

 

// If element is smaller than mid, then

// it can only be present in left subarray

if (arr[mid] > x)

return binarySearch(arr, l, mid - 1, x);

 

// Else the element can only be present

// in right subarray

return binarySearch(arr, mid + 1, r, x);

}

 

// We reach here when element is not present

// in array

return -1;

}

 

// Driver method to test above

public static void main(String args[])

{

BinarySearch ob = new BinarySearch();

char arr[] = {'a','c','e','f','g','h'};

int n = arr.length;

char x = 'g';

int result = ob.binarySearch(arr, 0, n - 1, x);

if (result == -1)

System.out.println("Character not present");

else

System.out.println("Character found at index " + result);

}

}

2)

import java.io.*;

import java.util.*;

public class Test{

public static boolean checksame(String s)

{

 

Stack<Integer> stack= new Stack<Integer>();

for(int i=0;i<s.length();i++)

{

if(s.charAt(i)=='0')

{

if(stack.empty()==false)

{

if((Integer)stack.peek()==1)

stack.pop();

else

stack.push(0);

}

else

{

stack.push(0);

}

}

else if(s.charAt(i)=='1')

{

if(stack.empty()==false)

{

if((Integer)stack.peek()==0)

stack.pop();

 

else

stack.push(1);

}

else

{

stack.push(1);

}

 

}

}

return stack.empty();

}

public static void main(String []args){

System.out.println(checksame("a0w1220"));

}

}

Explanation:

5 0
3 years ago
The ____ algorithm was the first public key encryption algorithm developed (in 1977 and published for commercial use.
Whitepunk [10]
The RSA Algorithm was developed by and named after the initials of: Ron Rivist, Adi Shamir, and Leonard Adleman while they were working at MIT. It was developed in 1977 and published in 1978.  The algorithm uses the exponentiation modulo in encrypt and decrypt information. 
7 0
3 years ago
By definition, what is the process of reducing security exposure and tightening security controls?
saw5 [17]

Hardening is the technique of reducing security exposure and tightening security controls of software and network devices.

Security is a major concern, when connecting over a network. Through hardening, security of a network is protected from vulnerable activities. Hardening reduces exposures associated with security and provides tight controls for it.

Hardening is typically a collection of tools and techniques that are used to decrease vulnerability in computer software, applications, network devices and infrastructure. The main goal of hardening is to protect security by identifying and eliminating superfluous programs, applications, permissions and access, which in turn, reduces the chances that attackers and malware will gain access over the network ecosystem.

You can learn more about hardening at

brainly.com/question/27912668

#SPJ4

7 0
2 years ago
Machines may aid in making work easier over a longer distance. true or false.
Dmitry [639]
This seems like more of an opinion based question, but since they added "over a longer distance" If I were you I would go with false.
4 0
3 years ago
WRITE A JAVA PROGRAM TO PRINT THE PATTERN<br> 13579<br> 2468<br> 357<br> 46<br> 5
Inessa05 [86]

Answer:

import java.util.Scanner;

import java.lang.*;

class Main

{

  public static void main(String args[])

  {

     int n;

     //For capturing the value of n

     Scanner scanner = new Scanner(System.in);

     System.out.println("Enter the value of n:");

     //The entered value is stored in the var n

     n = scanner.nextInt();

     int k=1;

     printnum(n,k);  

  }

  public static void printnum(int n,int k)

  {

       if(n%2==0)

       {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

       }

       else

        {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

        }

      n--;

      if(n<=1)

      {

         System.exit(0);

      }

      else

      {

          printnum(n,k+1);

      }

   }

}

Explanation:

The program is self explanatory.

4 0
3 years ago
Other questions:
  • A way to minimize technical problems with your computer
    14·1 answer
  • A program that coaches you at each step in the process is said to have a(n)
    12·2 answers
  • On what basis can you categorize the generations of computers?
    5·1 answer
  • 1. Use the Storyboard Template.
    11·1 answer
  • Write a programme with C++ language wich print the biggest number in between three numbers , whith INT
    14·1 answer
  • Given the business rule "an employee may have many degrees," discuss its effect on attributes, entities, and relationships. (Hin
    10·1 answer
  • A connection between files that allows data to be transferred from one file to another is a _______________________.
    6·1 answer
  • What is the easiest way to deploy a C++ program to a user’s computer? a. Copy the source code to the user’s computer and then co
    13·1 answer
  • It's important to understand that even information systems that do not use computers
    14·1 answer
  • What is the full form of MOS<br>​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!