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

Answer using Jupyter Python #Prompt the user to enter a passing grade and store the value...

Answer using Jupyter Python

#Prompt the user to enter a passing grade and store the value from
#the input() into a variable.

#Refer to the variable in problem 2 to complete the following:
#Use the if statement to evaluate the only the first element in the
#grades list using index notation.
#If the grade is passing, display PASSED, otherwise display FAILED.

"""Problem 1d"""
#Use the for statement to iterate on each element in the
#grades list (from problem 1a) and displays each value.
#Specifically, for each grade in the grades list, if the grade is
#passing (referring to problem 1b), then display PASSED, otherwise display FAILED.

"""Problem 2a"""
#Create a function that will evaluate if each grade in a list is considered
#passing or failing. [hint: use the for statement and if...else together]
#Store the total number of passing and failing grades in their own respective variables.
#The function should return a dictionary with two key-value pairs where the keys are
# the words PASSED and FAILED mapped to their total counts variable.

"""Problem 2b"""
#Call the function and pass in the grades list (from problem 1a) as an argument.

In: Computer Science

1. Implement the function calculate_score that consumes three parameters, two strings and a list. The strings...

1. Implement the function calculate_score that consumes three parameters, two strings and a list. The strings will each be ONE character and will represent a nucleotide. The list will be a nested int list representing a 4x4 score matrix. This function will return the value (int) from the nested int list at the location of the two referenced nucleotides.

a. An example call to calculate_score would be calculate_score(“A”, “T”, score_matrix). If we look at the alignment score table in the background section we can see that the cell at column “A” and row “T” holds the value 6. Similarly, if we consider this location via the indexes in score_matrix, we can use the index call score_matrix[1][2] to reach the value.

b. We can assume that the score matrix will always be a 4x4 nested int list in the same order as the matrix shown above.

c. You can use this index dictionary in your code for reference, or implement some other way to associate the string arguments to the appropriate index locations: {"G":0, "A":1, "T":2, "C":3}

d. Write three assert_equal statements.

In Python language

In: Computer Science

Write in Java! (Not Javascript) Consider the LinkedList class we discussed in class (see the slides...

Write in Java! (Not Javascript)

Consider the LinkedList class we discussed in class (see the slides for lecture 8). Add the following methods to the class and submit the completed LinkedList class.

  • int size() which returns the size of the linked list
  • Link getElementByIndex(int index) which returns the Link/node specified by the index. For example, getElementByIndex(0) should return the first Link, getElementByIndex(2) should return the third Link. If index is not in range, your method should return null.
  • boolean hasDuplicate() which returns true if the linked list contains duplicate data, returns false if there is no duplicate data in the list.
  • Link reverse() which reverses the linked list and returns the new head/first of the linked list (which is of type Link)

your file to be submitted to Gradescope should be named LinkedList.java. and here is the skeleton:

class Link

{

    public int data; // assuming integer data

    public Link next; // reference to the next Link

    //--------------------------------------------------------------

    // Constructor

    public Link(int data)

    {

        this.data = data;

        next = null;

    }

}

public class LinkedList

{

// implement this class

}

In: Computer Science

The following tables form part of a database held in a relational DBMS: Hotel (hotelNo, hotelName,...

The following tables form part of a database held in a relational DBMS:

Hotel (hotelNo, hotelName, hotelAddress, country)

Room (roomNo, hotelNo, type, price)

Guest (guestNo, guestName, guestAddress, country)

Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)

Write the SQL statements for the following questions:

1. List the rooms that are currently unoccupied at the Grosvenor Hotel, for:

(a) Use 2019-10-01 as today's date. Include all 'Grosvenor' hotels. List in hotelNo, roomNo order. Use NOT IN to perform the difference operation

(b) Use 2019-10-01 as today's date. Include all 'Grosvenor' hotels. List in hotelNo, roomNo order. Use NOT EXISTS to perform the difference operation.

(c) Use 2019-10-01 as today's date. Include all 'Grosvenor' hotels. List in hotelNo, roomNo order. Use LEFT JOIN to perform the difference operation.

(d) Use 2019-10-01 as today's date. Include all 'Grosvenor' hotels. List in hotelNo, roomNo order. Use MINUS to perform the difference operation.

In: Computer Science

***JAVA PROGRAM Write a method called shrink that accepts an array of integers (that the user...

***JAVA PROGRAM

Write a method called shrink that accepts an array of integers (that the user inputs) as a parameter and returns a new array containing the result of replacing each pair of integers with the sum of that pair. For example, if an array called list stores the values {7, 2, 8, 9, 4, 15, 7, 1, 9, 10}, then the call of shrink(list) should return a new array containing {9, 17, 19, 8, 19}.

The first pair from the original list is shrunken into 9 (7 + 2),

the second pair is shrunken into 17 (8 + 9), and so on.

If the list stores an odd number of elements, the final element is not collapsed. For example, if the list had been {1, 2, 3, 4, 5}, then the call would return {3, 7, 5}. Your method should not change the array that is passed as a parameter.

Be sure to have a shrink() method

*All variable names are completely up to you, as long as they’re descriptive

*Use the correct data types

*Use comments to explain what you’re coding

*Put your name in a comment

In: Computer Science

Write a MIPS program to implement the Bubble Sort algorithm, that sorts an input list of...

Write a MIPS program to implement the Bubble Sort algorithm, that sorts an input list of

integers by repeatedly calling a “swap” subroutine.

The original unsorted list of integers should be received from the keyboard input. Your program should first prompt the user “Please input an integer for the number of elements:”. After the user enters a number and return, your program outputs message “Now input each element and then a return:”. For example, if the user enters 8 as the number of integers, and then the sequence of integers one by one: 6,5,9,1,7,0,-3,2,-8, it should display “The elements are sorted as: -8, -3, 0, 1, 2, 4, 6, 7, 9” (the output sequence of integers should be either space-separated or comma-separated).

The final sorted list (in increasing order) should be stored in the data area, that starts with the label "list:".

You should NOT implement a different sorting algorithm (e.g. mergesort or quick sort). You will receive 0% if your program does not call subroutine "swap", or if your sorted list is in decreasing order.

In: Computer Science

The pedigree from Parts A and B is shown below. Now it shows the inheritance of a rare recessive autosomal condition that affects individuals

The pedigree from Parts A and B is shown below. Now it shows the inheritance of a rare recessive autosomal condition that affects individuals II-3, IV-2, IV-5, and V-3 (denoted by the filled symbols and the genotype aa). Individuals I-1, I-2, I-5, and I-6 have no history of this condition in their families.

In: Biology

Consider the circuit shown in the following figure. The battery has emf 50.0 V and negligible internal resistance.

Consider the circuit shown in the following figure. The battery has emf 50.0 V and negligible internal resistance. R2 = 3.00 Ω, C1= 3.00 μF, and C2= 6.00 μF. After the capacitors have attained their final charges, the charge on C1 is Q1 = 15.0 μC.

A) What is the final charge on C2?

B) What is the resistance R1?

In: Physics

Ann obtains a fully amortizing 30 year Fixed Rate Mortgage with monthly payments for $4,500,000 at...

Ann obtains a fully amortizing 30 year Fixed Rate Mortgage with monthly payments for $4,500,000 at 4.38%. What percent of Ann’s 20th payment goes to interest?

If Ann obtains a fully amortizing 30 year Fixed Rate Mortgage with monthly payments for $4,500,000 at 4.38%. What percent of Ann’s 20th payment goes to principal?v

In: Finance