Questions
in phyton programming: with numpy Create a function called biochild.  The function has as parameters...

in phyton programming:
with numpy
Create a function called biochild.
 The function has as parameters the number m and the lists ??????h?? and ??????h??.

 The lists ??????h?? and ??????h?? contain 0’s and 1’s.
 For example: ??????h?? = [1,0,0,1,0,1] and ??????h?? = [1,1,1,0,0,1]
 Both lists have the same length ?.
 The 0's and 1's represent bits of information (remember that a bit is 0 or 1).

 The function has to generate a new list (child).  The child list must have the same length ?.
 child is generated by randomly combining part of the child's information ??????h?? and ??????h??.
 The first part of the child list will be made up of the first ? bits of ??????h?? and the second part by the last ? - ? bits of the ??????h??.
 For example, if ? = 3, ??????h?? = [?, ?, ?, 1,0,1] and ??????h?? = [1,1,1, ?, ?, ?], then ?h??? = [1,0,0,0,0,1].
 The value ? has to be chosen randomly by the function.

 After generating child, each bit in the list is considered for mutation.
 For each bit of child, with probability ? the bit is “mutated” by being replaced by its inverse (If the bit is 0 it is replaced by 1, and if it is 1 it is replaced by 0).
 Finally, the function returns the list child.

In: Computer Science

Design and analyze asymptotically an O(nlgn) transform-conquer algorithm for the following problem: input: an array A[lo..hi]...

Design and analyze asymptotically an O(nlgn) transform-conquer algorithm for the following problem:

    • input: an array A[lo..hi] of n real values;
    • output: true iff the array contains two elements (at different indices) whose sum is 2020.

In: Computer Science

For the TCP header of a data packet shown below, find the following parameters. (1) Source...

For the TCP header of a data packet shown below, find the following parameters.

(1) Source port number

(2) Destination port number

(3) Sequence number

(4) Acknowledgement number

(5) Header length

(6) Window size

(7) a. Which flag is on?

b. What is the type/purpose of this communication?

0 0 0 0   0 0 0 1   0 0 1 0   0 1 0 0   0 0 0 0   0 0 0 1   0 0 0 1   0 1 0 1

0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 1   0 0 0 0

0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 1   0 0 0 1

0 1 0 1   0 0 0 0   0 0 0 0   0 0 1 0   0 0 0 0   0 0 0 1   0 0 0 1   0 0 0 0

0 0 0 1   1 1 0 0   0 0 0 1   1 0 0 1   0 0 1 0   1 0 0 0   0 0 0 1   1 0 1 0

In: Computer Science

For the 0-1 Knapsack algorithm, is it necessary to maintain the entire 2-dimensional table in memory...

For the 0-1 Knapsack algorithm, is it necessary to maintain the entire 2-dimensional table in memory throughout the computation, in order to compute the value of the best packing of the knapsack?

For the 0-1 Knapsack algorithm, is it necessary to maintain the entire 2-dimensional table in memory throughout the computation, in order to identify the items that are included in an optimal packing of the knapsack?

For the Longest Common Subsequence algorithm, is it necessary to maintain the entire 2-dimensional table in memory throughout the computation, in order to compute the actual characters in a longest-common-subsequence?

Yes/No then why. Short answers please

In: Computer Science

Using C# programming language, Write a program that sort three numbers entered by the user using...

Using C# programming language, Write a program that sort three numbers entered by the user using only if and nested if statements. If for instance the user entered 5, 2, and 7; the program should display 2,5,7.

In: Computer Science

Using c# programming language Write a program that mimics a lottery game. Have the user enter...

Using c# programming language Write a program that mimics a lottery game. Have the user enter 3 distinct numbers between 1 and 10 and match them with 3 distinct, randomly generated numbers between 1 and 10. If all the numbers match, then the user will earn $10, if 2 matches are recorded then the user will win $3, else the user will lose $5. Keep tab of the user earnings for, let say 5 rounds. The user will start with $25.

In: Computer Science

show some example of few recursive problem in java language and the solution code. Need more...

show some example of few recursive problem in java language and the solution code. Need more practice as a new learner

In: Computer Science

Data Structures has been classified into two based on its data organization. What are they? Explain...

Data Structures has been classified into two based on its data organization. What are they? Explain with example and neat diagrams and show how the data are organized in them.

In: Computer Science

PYTHON BEGINNER Problem Create a program that lets the user play a simplified game of Blackjack,...

PYTHON BEGINNER Problem Create a program that lets the user play a simplified game of Blackjack, which is played between the user and an automated dealer as follows.

The dealer shuffles a standard deck of 52 cards, draws two cards, and gives them to the user. The user can then choose to request another card from the dealer, adding it to their hand. The user can continue to request cards or choose to stop at any time. After each time the user requests a card, the program should output the cards in the player's updated hand and their total point value (see the function decomposition section below for how to calculate points). If, when receiving a new card, the total number of points in the hand goes over 21, the user loses. In this case, the dealer does not play.

Once the user chooses to not draw any more cards, it is the dealer's turn to play, which is automated as follows. The dealer begins by drawing two cards. As long as the point value of the dealer's hand is less than 17, the dealer draws another card. When the point value of the hand is between 17 and 21 (inclusive), the dealer stops and the two hands (users and dealer's) are compared. The player with the highest point value wins. If the point value of the dealer's hand goes over 21, the dealer has lost.

When the game ends, the program should output the outcome along with both player's hands.

Instructions Create a new Python file and place intro comments using the template below. Use comments to write the algorithm your program will follow, including functions.

In: Computer Science

What is the command (cisco IOS) to assign Port Fa0/1 to VLAN with ID 10.

  1. What is the command (cisco IOS) to assign Port Fa0/1 to VLAN with ID 10.

In: Computer Science

List methods for assigning packets to VLANs.

List methods for assigning packets to VLANs.

In: Computer Science

Develop a C++/Python program using visual studio connected to mysql workbench to show all vendor's name...

Develop a C++/Python program using visual studio connected to mysql workbench to show all vendor's name and phone (vendor_name and vendor_phone) in the state "CA" and the city "Los Angeles".

here is the database tables

CREATE TABLE general_ledger_accounts
(
account_number INT PRIMARY KEY,
account_description VARCHAR(50) UNIQUE
);

CREATE TABLE terms
(
terms_id INT PRIMARY KEY AUTO_INCREMENT,
terms_description VARCHAR(50) NOT NULL,
terms_due_days INT NOT NULL
);

CREATE TABLE vendors
(
vendor_id INT PRIMARY KEY AUTO_INCREMENT,
vendor_name VARCHAR(50) NOT NULL UNIQUE,
vendor_address1 VARCHAR(50),
vendor_address2 VARCHAR(50),
vendor_city VARCHAR(50) NOT NULL,
vendor_state CHAR(2) NOT NULL,
vendor_zip_code VARCHAR(20) NOT NULL,
vendor_phone VARCHAR(50),
vendor_contact_last_name VARCHAR(50),
vendor_contact_first_name VARCHAR(50),
default_terms_id INT NOT NULL,
default_account_number INT NOT NULL,
CONSTRAINT vendors_fk_terms
FOREIGN KEY (default_terms_id)
REFERENCES terms (terms_id),
CONSTRAINT vendors_fk_accounts
FOREIGN KEY (default_account_number)
REFERENCES general_ledger_accounts (account_number)
);

CREATE TABLE invoices
(
invoice_id INT PRIMARY KEY AUTO_INCREMENT,
vendor_id INT NOT NULL,
invoice_number VARCHAR(50) NOT NULL,
invoice_date DATE NOT NULL,
invoice_total DECIMAL(9,2) NOT NULL,
payment_total DECIMAL(9,2) NOT NULL DEFAULT 0,
credit_total DECIMAL(9,2) NOT NULL DEFAULT 0,
terms_id INT NOT NULL,
invoice_due_date DATE NOT NULL,
payment_date DATE,
CONSTRAINT invoices_fk_vendors
FOREIGN KEY (vendor_id)
REFERENCES vendors (vendor_id),
CONSTRAINT invoices_fk_terms
FOREIGN KEY (terms_id)
REFERENCES terms (terms_id)
);

CREATE TABLE invoice_line_items
(
invoice_id INT NOT NULL,
invoice_sequence INT NOT NULL,
account_number INT NOT NULL,
line_item_amount DECIMAL(9,2) NOT NULL,
line_item_description VARCHAR(100) NOT NULL,
CONSTRAINT line_items_pk
PRIMARY KEY (invoice_id, invoice_sequence),
CONSTRAINT line_items_fk_invoices
FOREIGN KEY (invoice_id)
REFERENCES invoices (invoice_id),
CONSTRAINT line_items_fk_acounts
FOREIGN KEY (account_number)
REFERENCES general_ledger_accounts (account_number)
);

-- create the indexes
CREATE INDEX invoices_invoice_date_ix
ON invoices (invoice_date DESC);

-- create some test tables that aren't explicitly
-- related to the previous five tables
CREATE TABLE vendor_contacts
(
vendor_id INT PRIMARY KEY,
last_name VARCHAR(50) NOT NULL,
first_name VARCHAR(50) NOT NULL
);

CREATE TABLE invoice_archive
(
invoice_id INT NOT NULL,
vendor_id INT NOT NULL,
invoice_number VARCHAR(50) NOT NULL,
invoice_date DATE NOT NULL,
invoice_total DECIMAL(9,2) NOT NULL,
payment_total DECIMAL(9,2) NOT NULL,
credit_total DECIMAL(9,2) NOT NULL,
terms_id INT NOT NULL,
invoice_due_date DATE NOT NULL,
payment_date DATE
);

In: Computer Science

P4.7 Following Section 4.9, develop a program that reads a string and removes all duplicates. For...

P4.7 Following Section 4.9, develop a program that reads a string and removes all duplicates. For example, if the input is Mississippi, print Misp. Start small and just print the first letter. Then print the first letter and true if the letter is not duplicated elsewhere, false otherwise. (Look for it in the remaining string, by using the substring and indexOf method). Next, do the same for the first two letters, and print out for each letter whether or not they occur in the substring before and after the letter. Try with a string like oops. Extend to all characters in the string. Have a look at the output when the input is Mississippi. Which character should you not report? At this time, you should have gathered enough experience that you can complete the program.

In: Computer Science

C++ employees entering data for a report (or entering into a db, etc.) this section of...

C++

employees entering data for a report (or entering into a db, etc.)

this section of code will also calculate their average salary of all the entered salary amounts.

This example will use a for loop for a user given number of employees, and a nested do..while loop to enter salary information. Then find the average salary for all the entered values.

In: Computer Science

Using C++ code, write a program named q5.cpp to print the minimum of the sums x...

Using C++ code, write a program named q5.cpp to print the minimum of the sums x + y^3 and x^3 + y, where x and y are input by a user via the keyboard.

In: Computer Science