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
Lyrx [107]
3 years ago
15

The following program includes fictional sets of the top 10 male and female baby names for the current year. Write a program tha

t creates: A set all_names that contains all of the top 10 male and all of the top 10 female names. A set neutral_names that contains only names found in both male_names and female_names. A set specific_names that contains only gender specific names. Sample output for all_names: {'Michael', 'Henry', 'Jayden', 'Bailey', 'Lucas', 'Chuck', 'Aiden', 'Khloe', 'Elizabeth', 'Maria', 'Veronica', 'Meghan', 'John', 'Samuel', 'Britney', 'Charlie', 'Kim'} NOTE: Because sets are unordered, they are printed using the sorted() function here for comparison
Computers and Technology
1 answer:
bazaltina [42]3 years ago
4 0

Answer:

Following are the program in the Python Programming Language.

male_names = {'kay', 'Dev', 'Sam', 'Karan', 'Broly', 'Samuel', 'Jayd', 'Lucifer', 'Amenadiel', 'Anmol'}

female_names = {'Kally', 'Megha', 'Lucy', 'Shally', 'Bailey', 'Jayd', 'Anmol', 'Beth', 'Veronica', 'Sam'}

#initialize the union from male_names and female_names

all_names = male_names.union(female_names)

#Initialize the similar names from male_names and female_names  

neutral_names = male_names.intersection(female_names)

#initialize the symmetric_difference from male_names and female_names

specific_names = male_names.symmetric_difference(female_names)

#print the results

print(sorted(all_names))

print(sorted(neutral_names))

print(sorted(specific_names))

<u>Output</u>:

['Amenadiel', 'Anmol', 'Bailey', 'Beth', 'Broly', 'Dev', 'Jayd', 'Kally', 'Karan', 'Lucifer', 'Lucy', 'Megha', 'Sam', 'Samuel', 'Shally', 'Veronica', 'kay']

['Anmol', 'Jayd', 'Sam']

['Amenadiel', 'Bailey', 'Beth', 'Broly', 'Dev', 'Kally', 'Karan', 'Lucifer', 'Lucy', 'Megha', 'Samuel', 'Shally', 'Veronica','kay']

Explanation:

<u>The following are the description of the program</u>.

  • In the above program, firstly we set two list data type variables 'male_names' and 'female_names' and initialize the male and female names in those variables.
  • Then, we set three variables in which we store union, intersection, and symmetric differences and finally print these three variables in a sorted manner.
You might be interested in
Which of the following describes a BYOD?
Law Incorporation [45]

Answer:

A policy allowing or encouraging employees, contractors, and others to connect their own computers, smartphones, and other devices to their organization's networks.

Explanation:

BYOD - Bring Your Own Device

6 0
3 years ago
____________________________ and _________________________ are 2 positive impacts of the internet on businesses.
ZanzabumX [31]
D improved comms and easy ads
4 0
2 years ago
Read 2 more answers
One of the earlier applications of crypto-graphic hash functions was the storage of passwords to authenticate usersin computer s
vagabundo [1.1K]

Answer: provided in the explanation part.

Explanation:

This is actually quite long but nevertheless i will make it as basic as possible.

Question (a)  

Attack A:

One way property of hash means that we can't find the input string if given the hash value. The calculation of hash from input string is possible but it is not possible to calculate the input string when given the hash. If the hash function is properly created to have one-way property then there is no way of finding the exact input string. So this attack won't work as the one-way property of hash function can't be broken if the hash function is properly created.

Attack B:

Suppose h() is the hash function. And h(x) = m where x is the string and m is the hash. Then trying to find another string y such that h(y) = m is called finding out the second pre-image of the hash.

Although we can't know the exact initial string for sure, we can by using brute force method find out a second preimage.

This attack will take a very long time. It has the time complexity of 2n. It requires the attacker to have an idea about the kind of passwords that might be used and then brute force all of them to find the string that has the same hash. Each try will have a chance of 1/2n to succeed.

Rainbow attack using rainbow table is often used for such brute-force attack. This comprises a rainbow table which contains passwords and their pre-hashed values.

Therefore, it is not possible to determine the second preimages of h so easily.

Attack C:

Collisions refer to finding out m and m' without knowing any of them. Finding out collisions is easier than finding preimages. This is because after finding out 2n pairs of input/output. The probability of two of them having the same output or hash becomes very high. The disadvantage is that we can't decide which user's hash to break. However, if I do not care about a particular user but want to get as many passwords as possible, then this method is the most feasible.

It has the time complexity of 2n/2.

Hence, this is the attack which has the most success rate in this scenario.

Question (b)

The brute force way of finding out the password usually involves using a rainbow attack. It comprises a rainbow table with millions of passwords and their hashes already computed. By matching that table against the database, the password can be recovered.

Therefore it is often preferred to salt the password. It means we add some random text to the password before calculating the hash.

The salts are usually long strings. Although users usually do not select long passwords, so a rainbow table with hashes of smaller passwords is feasible. But once salt is used, the rainbow table must accommodate for the salt also. This makes it difficult computationally. Although password might be found in the rainbow table. The salt can be anything and thus, make brute-force a LOT more difficult computationally.

Therefore salt is preferred to be added to passwords before computing their hash value.

Question (c)

A hash output length of 80 means there can be exactly 280 different hash values. This means there is at least one collision if 280+1 random strings are hashed because 280 values are used to accommodate all the possible strings. It is not hard with today's computation power to do match against more than this many strings. And doing so increases the probability of exposing a probable password of a user.

Hence, 80 is not a very secure value for the hash length.

cheers i hope this helps!!!!

6 0
3 years ago
2.1 Changes in which factors could cause aggregate demand to shift from AD to AD1? What could happen to the unemployment rate? W
katrin [286]

Answer:

There are many factors that cause aggregate demand to shift from AD to AD1. The unemployment rate will fall and inflation will increase.

<u>Explanation:</u>

A Shift in aggregate demand from AD to AD1 means there has been a  fall in demand. Various factors that cause demand to decrease are:

  1. Increase in price of a good itself
  2. Increase in the price of complimentary goods-This will lead to a fall in demand. Like ink and pen are complementary goods. if the Price of ink increases then demand for pen will decrease.
  3. A Decrease in the price of substitute goods-Like tea and coffee.
  4. Expectation regarding future fall in price

So due to the decrease in demand finally the unemployment will increase and with that, the inflation rate will increase making  things dearer.

3 0
3 years ago
PLEASE HELP ASAP! WILL MARK BRAINLIEST IF THE ANSWER IS CORRECT! I NEED HELP WITH THE 3RD ONE!
Bogdan [553]

Answer:

Explanation:

.1 Display all information from the customer table for all customers that have a balance that is greater than the average balance.

2. Display all information from the rep table for all representatives that have a rate which is equal to the minimum rate for representatives.

3. Display each unique description and price (no duplicates) for all parts that have a quoted price that is greater than the average quoted price for all parts ordered.

4. List all streets where either a customer or a representative is located

5 0
3 years ago
Other questions:
  • The ________ is(are) used to display information on the computer's screen.
    13·1 answer
  • An IT technician has manually configured an IP address on a laptop for a new employee. Each time the employee tries to connect t
    8·1 answer
  • A network administrator is implementing dhcpv6 for the company. the administrator configures a router to send ra messages with m
    6·1 answer
  • You can access various sites on the WWW by using hyperlinks or by
    14·1 answer
  • Adult learners understand a topic best by doing it. It gives them both new skills and confidence in their ability to carryout th
    6·1 answer
  • Int a = 1; int b = 0; int c = -1; if ((b + 1) == a) { b++; c += b; } if (c == a) { a--; b = 4; }
    7·1 answer
  • What will the "background-color" of the "topButton" be when the program is finished running?
    10·1 answer
  • Guys how can i video my self from my laptop <br> my laptop is (lenovo)
    8·2 answers
  • Fill in the blanks with the correct words.
    7·1 answer
  • Maria is conducting a security investigation and has identified a suspect. The suspect is an employee of the organization who ha
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!