Lab 7
.pdf
keyboard_arrow_up
School
Drexel University *
*We aren’t endorsed by this school
Course
410
Subject
Computer Science
Date
Jan 9, 2024
Type
Pages
8
Uploaded by MegaOysterMaster676
11/8/23, 5
:
06 PM
Lab 7
Page 1 of 8
file:///Users/mathabib/Documents/R%20files/Lab-7.html
Lab 7
Mathew H
2023-11-08
library
(magrittr)
library
(formattable)
library
(LearningStats)
library
(knitr)
Exercise 1:
Hand calc:
mean=3.5
sd=0.75
x=2
Z=(x-mean)/sd
Z=-2
Using table, prob = 0.0228
Using r:
pnorm1=pnorm(2,3.5,.75)
pnorm1
## [1] 0.02275013
Exercise 2:
Mean=37
sd=3.5
x=43
Z=1.714
Using table, prob is .9564 for probability of finding squid LESS than 43 feet Prob of 43 feet or more is 1-.9564,
so probability of squid longer than 43 feet is 0.0436
Using r:
11/8/23, 5
:
06 PM
Lab 7
Page 2 of 8
file:///Users/mathabib/Documents/R%20files/Lab-7.html
bigsquid=1-pnorm(43,37,3.5)
bigsquid
## [1] 0.04323813
Exercise 3:
By hand:
mean=70
sd=3
x=77,79
Z for 77 = 2.33 prob of less than 77 from table = .9901
Z for 79 = 3.00 prob of less than 79 from table = .9987
Prob of being between 77 to 79 in is equal to .9987-.9901 = .0086
Using r:
probtall=pnorm(79,70,3)-pnorm(77,70,3)
probtall
## [1] 0.008465431
Exercise 4:
By hand:
Mean=82
sd=5
x=?
top 10%
prob=0.90
Z (from table) = 1.29
1.29=(x-82)/5
Score to be in top 10% = 88.45%
using r:
11/8/23, 5
:
06 PM
Lab 7
Page 3 of 8
file:///Users/mathabib/Documents/R%20files/Lab-7.html
testprobs1=pnorm(80:90,82,5)
testprobs1
## [1] 0.3445783 0.4207403 0.5000000 0.5792597 0.6554217 0.7257469 0.7881446
## [8] 0.8413447 0.8849303 0.9192433 0.9452007
testprobs2=pnorm(c(88.1,88.2,88.3,88.4,88.5,88.6,88.7,88.8,88.9),82,5)
testprobs2
## [1] 0.8887676 0.8925123 0.8961653 0.8997274 0.9031995 0.9065825 0.9098773
## [8] 0.9130850 0.9162067
top 10% is about 88.5% on test
Exercise 5:
probnegheight=pnorm(-10,70,3)
probnegheight
## [1] 5.734783e-157
The return of this value is not a problem for the normal distribution because while it is above zero, it is such a
small chance that it can be said to be statistically impossible.
Exercise 6:
heights=read.csv("/Users/mathabib/Documents/R files/heights.csv")
heights=heights$Height
hist(heights,main="Histogram of Heights",xlim=c(60,100),breaks=20)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
please answer this question in Phython language.
the question is in the image below:
arrow_forward
Write this code in c++ language in 30 minutes
arrow_forward
package com.example.myapplication;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.ListView;public class PlayerActivity2 extends AppCompatActivity {ListView simpleList;String SerialNo[] = {"1", "2", "3", "4", "5", "6","7","8","9","10"};int flags[] = {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4, R.drawable.image5, R.drawable.image6, R.drawable.image7, R.drawable.image8, R.drawable.image9, R.drawable.image10};String Names[] = {"mmm", "nnn", "aaa.", "bbb", "ccc", "ddd","eee jk"," ijk","Virgil jk","gil jklk"};String Score[] = {"1", "2","3", "5", "4", "3","5","5","5","5"};@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity2);simpleList = (ListView)findViewById(R.id.simpleListView);//ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,…
arrow_forward
Assignment:
Change the styles of ordered list and unordered list
arrow_forward
computer graphics simple utilty curvei need to write c#.net and send the designi need same link design and code and output
https://www.codeproject.com/Articles/5267642/A-Simple-Utility-for-Drawing-Function-Curves
arrow_forward
The Problems - contains only problems from the last 2 contests
Separate Un-Attempted, Attempted and All cards Problem Difficulty Rating - The
Featured drop-down menu has different difficulty ranges so you can try problems that
best suit your experience.
Popular topics and brands Like most users, Chef didn't know that he could add
problems to his personal to-do list by clicking the magic "+" symbol in the upper
right corner of each problem page. But once he found out about it, he went crazy and
added a lot of problems to his to-do list without looking at their difficulty rating.
Rajesh is a beginner and ideally should only try to solve problems strictly below
10001000. Given the difficulty rating list of problems in Chef's to-do list, please help
him determine how many of these problems Chef should remove from his to-do list
so he is left with only problems with a difficulty rating of less than 10001000.
Note: Please answer the question in Python only:
Input
1
4
999 1000 1001 1002…
arrow_forward
Horizontal sequence :VIRL
Vertical sequence:MKF
Scoring rules: g/o = -3, g/e = -1, match or mismatch - from PAM250 substitution matrix below.
NW algorithm.
1. Complete the scoring matrix.
Scoring matrix with PAM250 scores:
V
I
R
L
M
K
F
2. Set up, initialize and complete the NW matrix.
3. Retrace, align and score alignment(s).
Use the arrows and circles for the matrix and path(s).
V
I
R
L
M
K
F
Align and score all optimal alignments here.
PLZ the arrows and circles for the matrix and path(s) AND SHOW ALL possible Alignment
arrow_forward
Horizontal sequence :VIRL
Vertical sequence:MKF
Scoring rules: g/o = -3, g/e = -1, match or mismatch - from PAM250 substitution matrix below.
NW algorithm.
1. Complete the scoring matrix.
Scoring matrix with PAM250 scores:
V
I
R
L
M
K
F
2. Set up, initialize and complete the NW matrix.
3. Retrace, align and score alignment(s).
Use the arrows and circles for the matrix and path(s).
V
I
R
L
M
K
F
Align and score all optimal alignments here.
arrow_forward
Horizontal sequence :VIRL
Vertical sequence:MKF
Scoring rules: g/o = -3, g/e = -1, match or mismatch - from PAM250 substitution matrix below.
SW algorithm.
1. Complete the scoring matrix.
Scoring matrix with PAM250 scores:
V
I
R
L
M
K
F
2. Set up, initialize and complete the SW matrix.
3. Retrace, align and score alignment(s).
Use the arrows and circles for the matrix and path(s).
V
I
R
L
M
K
F
Align and score all optimal alignments here.
PLZ the arrows and circles for the matrix and path(s) AND SHOW ALL possible Alignment
arrow_forward
Can you please give me an approach or two as to how to tackle this problem using the programming language C? I get that it is complex, but please, I really need your help with this one.
arrow_forward
An XHTML document that conforms to an XHTML specification is said to be valid.
+ + C D localhost8080/Form-Validation-Example/
Profile Employee
First Name David
Last Name waliams
First Name nost be between 3 nd 25 charncters
Lat Name must be between 3 and 25 characters
Sex
*Male OFemale Please select your gender
Date of burth 2107/1992
Please unput date of buth
javabycode@gmail.com Please input email
USA
Email
County
Please select your coustry
Submt.
Figure 1: Registration form
(a) Develop XHTML document for all the form controls displayed in the same sequence as shown in Figure 1.
(b) Once the applicant submit the application, your program must able to do data validation using JavaScript.
arrow_forward
II. Project Description
Parts Catalog
This project builds a parts catalog using a B-tree for storage.
Introduction:
Today a parts catalog would be built using a database for storage. Databases are very versatile in
their ability to store and retrieve data. In this project, you will build a parts catalog system as a single-user
system without the use of a database. Instead, you will create a B+-tree and store the parts data in it.
Overview:
This project consists of two parts: a B+-tree for storing parts data and a user interface for accessing
the data. These two parts should be independent, so that changing to another storage system or another
user interface is not too difficult.
Your project should allow the user to maintain a parts catalog. A flat-file of part data will be
provided. Your program should begin by loading data from the flat-file into a B+-tree. Once loaded, the
user can query for a particular part number, display the next 10 parts, modify the description of a part, add…
arrow_forward
PLEASE REFER TO THE IMAGES FOR INSTRUCTIONS
PLEASE USE STARTER CODE - CODE IN PYTHON3
### starter code
import random
def spider_web(web_map, starting_place, destination):
pass
def spider_web_rec(web_map, starting_place, destination, visited):
pass
def make_spider_web(num_nodes, seed=0):
if seed:
random.seed(seed)
web_map = {}
for i in range(1, num_nodes + 1):
web_map[f'Node {i}'] = []
for i in range(1, num_nodes + 1):
sample = random.sample(list(range(i, num_nodes + 1)), random.randint(1, num_nodes - i + 1))
print('sample', i, sample)
for x in sample:
if i != x:
web_map[f'Node {i}'].append(f'Node {x}')
web_map[f'Node {x}'].append(f'Node {i}')
return web_map
if __name__ == '__main__':
num_nodes, seed = [int(x) for x in input('Input num_nodes, seed: ').split(',')]
the_web = make_spider_web(num_nodes, seed)
print(spider_web(the_web, 'Node 1',…
arrow_forward
- Explain in detail about view-synchronous group
communication.
arrow_forward
X
Bb Lecture
X Bb Lecture0EX
Downloads/CSC%20Homework%202.pdf
Bb Lecture09
(4) int a = 5;
CD Page view
System.out.println(a);
(5) int a = 5;
(6) int a = 5;
a += 2;
(9)
X
System.out.println(a++);
Bb Lecture 10 X
int b = ++a 2;
System.out.println (b);
CSC 1106 HOMEWORK 2
System.out.println(a);
(7) int a = 5;
a/= a + 2;
System.out.println(a);
▬▬▬
▬▬
12/6=4
*CSC Hom
R
TAdd text
The output is 5.
X
google dic
Draw
System.out.println("25 plus 55 is " + 25 + 55);
Q Search
(8) System.out.println("He thrusts his fists\n\tagainst" +
"the post \nand still insists\n\the sees the \"ghost\"");
Y
[I]
X
Case Stuc
Highlight
X
arrow_forward
C-Lab1-InLabExercises-SectionSV2- Word
OUT
REFERENCES
MAILINGS
REVIEW
VIEW
* 21 1 AaBbCcDd AaBbCcDd AaBbCc AaBbt AaBbCcDr AaBbCc
1 Normal 1 No Spac. Heading 1 Heading 2 Heading 3 Heading 4
Styles
Paragraph
V Using comments
Problem Description
Without using any selection statement, develop and run a C program that
- Displays your information properly: student name, id, section number, instructor name, and student
email
Declare 2 arrays of integers, each array of size 3. The arrays should be called first and second
Declare an arrays of integers of size 4 called result
- Prompts (asks) the user to gnter.two positive integers, each integer of exactly 3 digits (such as 361).
- Read in each number using a single statement
Note: Assume the user will enter a proper number of exactly 3 digits, no need to check for improper input
The program inserts the 3 digits of the first number in the array called first.
Similarly, the program inserts the 3 digits of the second number in the array called…
arrow_forward
Find logic errors:
#include <Adafruit_NeoPixel.h>#include <string.h>
#define NEOS 8#define NPX 10#define AVGS 100
int runsamps[AVGS];double curavg;int count;
Adafruit_NeoPixel pixels(NPX, NEOS, NEO_GRB+NEO_KHZ800);
void setup() {// put your setup code here, to run once:pixels.begin();memset(runsamps, 0, AVGS*sizeof(int));count = 0;curavg = 50;}
void loop() {// put your main code here, to run repeatedly:int newdata;int scaleavg;pixels.clear();newdata = analogRead(8);curavg += (double)runsamps[count]/AVGS;runsamps[count] = newdata;curavg -= (double)newdata/AVGS;scaleavg = round(map(curavg, 0, 1023, 0, 10));for (int n = 0; n < scaleavg; n++){pixels.setPixelColor(n, pixels.Color(82, 35, 152));pixels.show();}delay(10);count++;}
arrow_forward
private FloatBuffer vals = Buffers.newDirectFloatBuffer(16);private Matrix4f pMat = new Matrix4f();private Matrix4f vMat = new Matrix4f();private Matrix4f mMat = new Matrix4f();private Matrix4f mvMat = new Matrix4f();private int pLoc, mvLoc;private float aspect;private double elapsedTime, startTime, tf;public Program4_3() {setTitle("Chapter4 - program3");setSize(600, 600);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);myCanvas = new GLCanvas();myCanvas.addGLEventListener(this);this.add(myCanvas);this.setVisible(true);}public void init(GLAutoDrawable drawable) {GL4 gl = (GL4) GLContext.getCurrentGL();renderingProgram = UtilsV7.createShaderProgram("./shaders/vertShader4_1_2.glsl", "./shaders/fragShader4_2.glsl");setupVertices();cameraX = 0.0f;cameraY = 0.0f;cameraZ = 8.0f;cubeLocX = 0.0f;cubeLocY = -2.0f;cubeLocZ = 0.0f;pyrLocX = 2.0f;pyrLocY = 2.0f;pyrLocZ = 0.0f;}public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}public void dispose(GLAutoDrawable…
arrow_forward
Geographical Information System (Describe GIS Data)
arrow_forward
Convert this Python script to a MATLAB script.
Hint: Use the matlab-python-cheatsheet.
End all assignment statements with a semi-colon to suppress output to screen.
Include the key word end at the end of your function.
You should try developing in MATLAB and not the quiz server.
def make_list(start, step, stop):
Creates a list - first element is start, last element is stop, each element value increases by step.
Parameters:
start - int - first element in list
step - int - value to increment each element by
stop - int - last element in list
Returns:
list of ints
return list(range(start, stop + 1, step))
For example:
Test
Result
disp(all(make_list(1, 2, 11)== [1 3 5 7 9 11]))
1
disp(all(make_list(10, -2, -10)
== [10 8 6 4 2 0 -2 -4 -6 -8 -10])) 1
arrow_forward
Create Java Book objects using the following data and place them in a List.
(Fields: Author, Title, Year, Price)
Java Programming,Deitel,2016,68.75Python Programming,Gaddis,2018,78.56Data Analytics,Norman,2017,89.56Block Chain Development,Wilson,2019,87.45Web Development,Brown,2018,98.98
Create TWO List Comparators to sort the Book objects in ascending order: One by Book Title and the second by Book Year.
Using each Comparator, SORT the List once by Title and again by Year.
NOTE: You MUST use the Comparator to SORT. Cannot use any other built in sort methods.
Output each SORTED List on Console in a format same as the data shown above (One Book per line, comma separated).
arrow_forward
@Build ER diagram
arrow_forward
Prof. Midas. Select all the findings which you will NOT present (i.e., select
all answers which are FALSE).
def key_in_dict(d, k):
for item in d:
if k == item:
return True
return False
O This code would always be slower than the builtin key lookup Python provides.
O A key lookup in a dictionary in Python is generally faster than determining
whether a value is in a list.
O This code is way faster and will be included in the next version of Python
(version 4.1).
O The code is incorrect from a functional perspective, the True and False should
be switched.
O This code could be replaced with one line: return k in d
O The code is correct and would always perform faster than the builtin key
lookup provided by Python.
arrow_forward
yWl öyiäll - wioilI jbisJl.docx [Compatibility Mode] - Word
Sign in
Insert
Design
Mailings
Help
O Tell me what you want to do
A Share
File
Home
Layout
References
Review
View
Q2) Implement the following method:
Drawing the polyline with the given points using the method drawPolygon
void draw2 (int x []
int y [], Graphics g ){
// Your code
}
Page 2 of 4
317 words
English (United States)
160%
5:41 PM
P Type here to search
A d))
G ENG
04/07/2021
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- please answer this question in Phython language. the question is in the image below:arrow_forwardWrite this code in c++ language in 30 minutesarrow_forwardpackage com.example.myapplication;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.ListView;public class PlayerActivity2 extends AppCompatActivity {ListView simpleList;String SerialNo[] = {"1", "2", "3", "4", "5", "6","7","8","9","10"};int flags[] = {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4, R.drawable.image5, R.drawable.image6, R.drawable.image7, R.drawable.image8, R.drawable.image9, R.drawable.image10};String Names[] = {"mmm", "nnn", "aaa.", "bbb", "ccc", "ddd","eee jk"," ijk","Virgil jk","gil jklk"};String Score[] = {"1", "2","3", "5", "4", "3","5","5","5","5"};@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity2);simpleList = (ListView)findViewById(R.id.simpleListView);//ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,…arrow_forward
- Assignment: Change the styles of ordered list and unordered listarrow_forwardcomputer graphics simple utilty curvei need to write c#.net and send the designi need same link design and code and output https://www.codeproject.com/Articles/5267642/A-Simple-Utility-for-Drawing-Function-Curvesarrow_forwardThe Problems - contains only problems from the last 2 contests Separate Un-Attempted, Attempted and All cards Problem Difficulty Rating - The Featured drop-down menu has different difficulty ranges so you can try problems that best suit your experience. Popular topics and brands Like most users, Chef didn't know that he could add problems to his personal to-do list by clicking the magic "+" symbol in the upper right corner of each problem page. But once he found out about it, he went crazy and added a lot of problems to his to-do list without looking at their difficulty rating. Rajesh is a beginner and ideally should only try to solve problems strictly below 10001000. Given the difficulty rating list of problems in Chef's to-do list, please help him determine how many of these problems Chef should remove from his to-do list so he is left with only problems with a difficulty rating of less than 10001000. Note: Please answer the question in Python only: Input 1 4 999 1000 1001 1002…arrow_forward
- Horizontal sequence :VIRL Vertical sequence:MKF Scoring rules: g/o = -3, g/e = -1, match or mismatch - from PAM250 substitution matrix below. NW algorithm. 1. Complete the scoring matrix. Scoring matrix with PAM250 scores: V I R L M K F 2. Set up, initialize and complete the NW matrix. 3. Retrace, align and score alignment(s). Use the arrows and circles for the matrix and path(s). V I R L M K F Align and score all optimal alignments here. PLZ the arrows and circles for the matrix and path(s) AND SHOW ALL possible Alignmentarrow_forwardHorizontal sequence :VIRL Vertical sequence:MKF Scoring rules: g/o = -3, g/e = -1, match or mismatch - from PAM250 substitution matrix below. NW algorithm. 1. Complete the scoring matrix. Scoring matrix with PAM250 scores: V I R L M K F 2. Set up, initialize and complete the NW matrix. 3. Retrace, align and score alignment(s). Use the arrows and circles for the matrix and path(s). V I R L M K F Align and score all optimal alignments here.arrow_forwardHorizontal sequence :VIRL Vertical sequence:MKF Scoring rules: g/o = -3, g/e = -1, match or mismatch - from PAM250 substitution matrix below. SW algorithm. 1. Complete the scoring matrix. Scoring matrix with PAM250 scores: V I R L M K F 2. Set up, initialize and complete the SW matrix. 3. Retrace, align and score alignment(s). Use the arrows and circles for the matrix and path(s). V I R L M K F Align and score all optimal alignments here. PLZ the arrows and circles for the matrix and path(s) AND SHOW ALL possible Alignmentarrow_forward
- Can you please give me an approach or two as to how to tackle this problem using the programming language C? I get that it is complex, but please, I really need your help with this one.arrow_forwardAn XHTML document that conforms to an XHTML specification is said to be valid. + + C D localhost8080/Form-Validation-Example/ Profile Employee First Name David Last Name waliams First Name nost be between 3 nd 25 charncters Lat Name must be between 3 and 25 characters Sex *Male OFemale Please select your gender Date of burth 2107/1992 Please unput date of buth javabycode@gmail.com Please input email USA Email County Please select your coustry Submt. Figure 1: Registration form (a) Develop XHTML document for all the form controls displayed in the same sequence as shown in Figure 1. (b) Once the applicant submit the application, your program must able to do data validation using JavaScript.arrow_forwardII. Project Description Parts Catalog This project builds a parts catalog using a B-tree for storage. Introduction: Today a parts catalog would be built using a database for storage. Databases are very versatile in their ability to store and retrieve data. In this project, you will build a parts catalog system as a single-user system without the use of a database. Instead, you will create a B+-tree and store the parts data in it. Overview: This project consists of two parts: a B+-tree for storing parts data and a user interface for accessing the data. These two parts should be independent, so that changing to another storage system or another user interface is not too difficult. Your project should allow the user to maintain a parts catalog. A flat-file of part data will be provided. Your program should begin by loading data from the flat-file into a B+-tree. Once loaded, the user can query for a particular part number, display the next 10 parts, modify the description of a part, add…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning