text:
# Developing Codelets in Python¶

While in terms of performance, the best language for writing codelets is C++, not all codelets of an application need to be in the same language. The Isaac SDK also supports Python codelets, or pyCodelets, for those who are more familiar with Python.

This section shows you how to do the following:

• Run Python codelets, using ping_python included in the Isaac SDK as an example
• Create Python codelets

This section also describes the run script deployed with Python codelets to the target system, and the differences between JSON and Bazel BUILD files for C++ codelets and JSON and Bazel BUILD files for Python codelets.

## Running a Python Codelet¶

A Python version of the Ping codelet described in the Basics section can be found in the apps/tutorials/ping_python/ directory.

This application can be run on your system by executing the following command:

bob@desktop:~/isaac$bazel run //apps/tutorials/ping_python  If you want to run the application on a Jetson device you can have to follow these instructions 1. Deploy the ping_python-pkg to the target machine with the following command: bob@desktop:~/isaac$ ./engine/build/deploy.sh -p //apps/tutorials/ping_python:ping_python-pkg -h <target_ip> -d <device_type>

See the Deploying and Running on Jetson section for more details on deployment.

1. Change to the directory of the deployed package on Jetson with the following command:

bob@desktop:~/$cd ~/deploy/bob/ping_python-pkg Where "bob" is your username on the host system.  2. If you have not yet installed pycapnp, install it with the following command: bob@desktop:~/deploy/bob/ping_python-pkg/$ sudo apt install python-pip
bob@desktop:~/deploy/bob/ping_python-pkg/$python -m pip install pycapnp --user  This may take about five minutes to complete, but once pycapnp is installed it does not need to be installed again. If this step is omitted or forgotten the error “ImportError: No module named capnp” is displayed. 3. Run the application by executing the following command: bob@desktop:~/deploy/bob/ping_python-pkg/$ ./run apps/tutorials/ping_python/ping_python.py

When you run the codelet, by either method, a “Hello World!” message is printed every 1.5 seconds. Modify the script at apps/tutorials/ping_python/ping_python.py and run it again to see the effects of your changes.

A more complete example, the Python version of the Proportional Control codelet described in the A Complete Application section is shown below. The following Python script is functionally equivalent to a combination of main.cpp, ProportionalControlCpp.hpp, and ProportionalControlCpp.cpp:

from __future__ import absolute_import, division, print_function

from engine.pyalice import *
import apps.tutorials.proportional_control_python

# A Python codelet for proportional control
# For comparison, please see the same logic in C++ at "ProportionalControlCpp.cpp".
#
# We receive odometry information, from which we extract the x position.
# Then, using refence and gain parameters that are provided by the user,
# we compute and publish a linear speed command using
#   control = gain * (reference - position)
class ProportionalControlPython(Codelet):
def start(self):
# This part will be run once in the beginning of the program

# Input and output messages for the Codelet.
# We'll make connections in the json file.
self.rx = self.isaac_proto_rx("Odometry2Proto", "odometry")
self.tx = self.isaac_proto_tx("StateProto", "cmd")

# Parameters. We'll be able to modify them through Sight website.
self.set_isaac_param("desired_position_meters", 1.0)
self.set_isaac_param("gain", 1.0)

# Print some information
print("Please head to the Sight website at <IP>:<PORT> to see how I am doing.")
print("<IP> is the Internet Protocol address where the app is running,")
print("and <PORT> is set in the config file, typically to '3000'.")
print("By default, local link is 'localhost:3000'.")

# We can tick periodically, on every message, or blocking.
# See documentation for details.
self.tick_periodically(0.01)

def tick(self):
# This part will be run at every tick.
# We are ticking periodically in this example.

# Nothing to do if we haven't received odometry data yet
if not self.rx.available():
return

# Read parameters that can be set through Sight webpage
reference = self.get_isaac_param("desired_position_meters")
gain = self.get_isaac_param("gain")

position = self.rx.get_proto().odomTRobot.translation.x

# Compute the control action
control = gain * (reference - position)

# Show some data in Sight
self.show("reference (m)", reference)
self.show("position (m)", position)
self.show("control", control)
self.show("gain", gain)

# Publish control command
tx_message = self.tx.init_proto()
data = tx_message.init('data', 2)
data[0] = control  # linear speed
data[1] = 0.0  # This simple example sets zero angular speed
self.tx.publish()

def main():
app = Application("proportional_control_python", ["navigation", "segway", "sensors:joystick"])
"apps/tutorials/proportional_control_python/proportional_control_python.graph.json")
"apps/tutorials/proportional_control_python/proportional_control_python.config.json")
app.register({"py_controller": ProportionalControlPython})
app.start_wait_stop()

if __name__ == '__main__':
main()

Import statements in Python are analogous to preprocessor #include statements in C++. Like in ProportionalControlCpp.cpp, the codelet is defined in start and tick functions. The Isaac parameters desired_position_meters and gain are used, with values either configured in JSON files or set through Sight at runtime.

At every tick, if an odometry message is received, the appropriate command is computed and published for the robot. Some important data is displayed in Sight.

The main function simply loads the graph and configuration files before running the application, the way that main.cpp does in the C++ codelet.

## Creating Python Codelets¶

Follow a procedure similar to the following when creating your Python codelets.

### Create a Workspace¶

1. Copy apps/tutorials/proportional_control_python/ or another existing Python-based codelet to apps/<your_app_name> as a template or starting point.

If you use the Proportional Control codelet unmodified for this tutorial, a Carter robot or equivalent is required. See NVIDIA Carter for more information.

2. Rename the files to reflect the name of your codelet instead of the codelet you copied.

### Create a Bazel BUILD File¶

1. In apps/<your_app_name>/BUILD copied in with the other files used as a starting point, replace all proportional_control_python strings with <your_app_name>.

2. Modify the data property in the py_binary rule depending on the C++ codelets you use.

For example, if you were to omit or remove //packages/segway in apps/tutorials/proportional_control_python/BUILD, and run the codelet, the error Component with typename ‘isaac::SegwayRmpDriver’ not registered would be displayed, because the Proportional Control codelet (proportional_control_python.graph.json) uses the C++ based segway codelet.

3. Since our application is located in apps and not apps/tutorials, remove the specification of //apps/tutorials:py_init, leaving //apps:py_init in place.

If instead of moving the application up to apps, you move it to apps/tutorials/tutorials_sub, the BUILD file in apps/tutorials/tutorials_sub must specify py_init in all three directories, //apps:py_init, //apps/tutorials:py_init, and //apps/tutorials/tutorials_sub:py_init. Each directory would also need a copy of __init__.py.

### Create a Python Codelet¶

1. In your <your_app_name>.py, replace import apps.tutorials.proportional_control_python with import apps.<your_app_name>.

2. Rename and modify the ProportionalControlPython class as needed. You can define multiple Python codelets in this file.

3. In the main function, replace all proportional_control_python strings with <your_app_name>. You must register all pyCodelets using their class names, such as ProportionalControlPython in the files we used as a starting point. Modify node names, py_controller in this case, to match the name you chose in your graph.json file.

Your main function will be similar to the following:

def main():
app = Application("my_new_app")
app.register({"my_py_node1": PyCodeletType1, "my_py_node2a": PyCodeletType2, "my_py_node2b": PyCodeletType2})
app.start_wait_stop()

1. Add or remove nodes, components, or edges in apps/<your_app_name>/<your_app_name>.graph.json depending on your codelet.
2. Configure nodes and components in apps/<your_app_name>/<your_app_name>.config.json as needed. Make sure to replace all instances of the codelet name with the name of your new codelet.

Run the codelet locally or deploy and run it on a Jetson system as described in Running a Python Codelet.

## The run Script¶

The run script, provided along with deployment (using deploy.sh) of an Isaac application that includes a Python codelet or codelets, performs the following functions:

• Checks that the filename of the Python script ends in “.py”

• Verifies that every directory has an __init__.py file

• Runs the application using the following command.

PYTHONPATH=$PWD:$PWD/engine python

These functions are performed by the run script when we use the following command:

./run apps/tutorials/proportional_control_python/proportional_control_python.py

## JSON and BUILD Files for Python Codelets¶

JSON files for Python codelets are very similar to those for C++ codelets, except that the component type of Python codelets is always isaac::alice::PyCodelet.

Bazel BUILD files are somewhat different, as shown in the following example:

load("//engine/build:isaac.bzl", "isaac_pkg")

py_binary(
name = "proportional_control_python",
srcs = [
"__init__.py",
"proportional_control_python.py",
],
data = [
"proportional_control_python.config.json",
"proportional_control_python.graph.json",
"//apps:py_init",
"//apps/tutorials:py_init",
"//messages:core_messages",
"//packages/segway:libsegway_module.so",
"//packages/sensors:libjoystick_module.so",
],
deps = ["//engine/pyalice"],
)

isaac_pkg(
name = "proportional_control_python-pkg",
srcs = ["proportional_control_python"],
)

Use of C++ codelets is enabled by specifying the corresponding modules in data in the py_binary rule. For example, //packages/segway:libsegway_module.so is required to use C++ Codelet of type isaac::SegwayRmpDriver. Omitting or forgetting this dependency causes the error Component with typename ‘isaac::SegwayRmpDriver’ not registered to be displayed when the application is run.

The isaac_pkg rule is responsible for packing all the files up and creating an archive which can be transferred to the target device with the deploy script.


text:
# Homotopy

A continuous transformation from one mapping to another. One example is the convex combination: $LaTeX: t f(x) + (1-t)F(x)$. As $LaTeX: t$ varies from 0 to 1, the function changes continuously from $LaTeX: F$ to $LaTeX: f$.

format: plain


text:
# OpenStax_CNX

You are here: Home » Content » Collaborative Statistics » Homework

### Lenses

What is a lens?

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

#### In these lenses

• Lucy Van Pelt

This collection is included inLens: Lucy's Lens
By: Tahiya Marome

"Part of the Books featured on Community College Open Textbook Project"

Click the "Lucy Van Pelt" link to see all content selected in this lens.

Click the tag icon to display tags associated with this content.

• Bio 502 at CSUDH

This collection is included inLens: Bio 502
By: Terrence McGlynn

"This is the course textbook for Biology 502 at CSU Dominguez Hills"

Click the "Bio 502 at CSUDH" link to see all content selected in this lens.

Click the tag icon to display tags associated with this content.

### Recently Viewed

This feature requires Javascript to be enabled.

### Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

Inside Collection (Textbook):

Textbook by: Barbara Illowsky, Ph.D., Susan Dean. E-mail the authors

# Homework

Summary: This module provides a number of homework exercises related to Continuous Random Variables.

For each probability and percentile problem, DRAW THE PICTURE!

## Exercise 1

Consider the following experiment. You are one of 100 people enlisted to take part in a study to determine the percent of nurses in America with an R.N. (registered nurse) degree. You ask nurses if they have an R.N. degree. The nurses answer “yes” or “no.” You then calculate the percentage of nurses with an R.N. degree. You give that percentage to your supervisor.

• a. What part of the experiment will yield discrete data?
• b. What part of the experiment will yield continuous data?

## Exercise 2

When age is rounded to the nearest year, do the data stay continuous, or do they become discrete? Why?

## Exercise 3

Births are approximately uniformly distributed between the 52 weeks of the year. They can be said to follow a Uniform Distribution from 1 – 53 (spread of 52 weeks).

• a. X ~ X size 12{X} {} ~
• b. Graph the probability distribution.
• c. f ( x ) = f ( x ) size 12{f $$x$$ } {} =
• d. μ = μ size 12{μ} {} =
• e. σ = σ size 12{σ} {} =
• f. Find the probability that a person is born at the exact moment week 19 starts. That is, find P ( x = 19 ) = P ( x = 19 ) size 12{P $$X="19"$$ } {} =
• g. P ( 2 < x < 31 ) = P ( 2 < x < 31 ) = size 12{P $$2<X<"31"$$ ={}} {}
• h. Find the probability that a person is born after week 40.
• i. {} P ( 12 < x x < 28 ) = P ( 12 < x x < 28 ) size 12{P $$"12"<X \lline X<"28"$$ } {} =
• j. Find the 70th percentile.
• k. Find the minimum for the upper quarter.

### Solution

• a. X ~ U ( 1, 53 ) X ~ U ( 1, 53 ) size 12{X " ~ " U $$1,"53"$$ } {}
• c. f(x)=152f(x)=152 size 12{f $$x$$ = { {1} over { $$b - a$$ } } = { {1} over { $$"53" - 1$$ } } = { {1} over {"52"} } } {} where 1x531x53 size 12{1 <= x <= "53"} {}
• d. 27
• e. 15.01
• f. 0
• g. 29522952
• h. 13521352
• i. 16271627
• j. 37.4
• k. 40

## Exercise 4

A random number generator picks a number from 1 to 9 in a uniform manner.

• a. X ~ X ~ size 12{X "~" } {}
• b. Graph the probability distribution.
• c. f ( x ) = f ( x ) = size 12{f $$x$$ ={}} {}
• d. μ = μ = size 12{μ={}} {}
• e. σ = σ = size 12{σ={}} {}
• f. P ( 3 . 5 < x < 7 . 25 ) = P ( 3 . 5 < x < 7 . 25 ) = size 12{P $$3 "." 5<X<7 "." "25"$$ ={}} {}
• g. P ( x > 5 . 67 ) = P ( x > 5 . 67 ) = size 12{P $$X>5 "." "67"$$ ={}} {}
• h. P ( x > 5 x > 3 ) = P ( x > 5 x > 3 ) = size 12{P $$X>5 \lline X>3$$ ={}} {}
• i. Find the 90th percentile.

## Exercise 5

The time (in minutes) until the next bus departs a major bus depot follows a distribution with f(x)=120f(x)=120 where xx goes from 25 to 45 minutes.

• a. Define the random variable. X = X = size 12{X={}} {}
• b. X ~ X ~ size 12{X "~" } {}
• c. Graph the probability distribution.
• d. The distribution is ______________ (name of distribution). It is _____________ (discrete or continuous).
• e. μ = μ = size 12{μ={}} {}
• f. σ = σ = size 12{σ={}} {}
• g. Find the probability that the time is at most 30 minutes. Sketch and label a graph of the distribution. Shade the area of interest. Write the answer in a probability statement.
• h. Find the probability that the time is between 30 and 40 minutes. Sketch and label a graph of the distribution. Shade the area of interest. Write the answer in a probability statement.
• i. P(25<x<55)=P(25<x<55)= size 12{P $$"25"<X<"55"$$ ={}} {} _________. State this in a probability statement (similar to g and h ), draw the picture, and find the probability.
• j. Find the 90th percentile. This means that 90% of the time, the time is less than _____ minutes.
• k. Find the 75th percentile. In a complete sentence, state what this means. (See j.)
• l. Find the probability that the time is more than 40 minutes given (or knowing that) it is at least 30 minutes.

### Solution

• b. X ~ U ( 25 , 45 ) X ~ U ( 25 , 45 ) size 12{X "~" U $$"25","45"$$ } {}
• d. uniform; continuous
• e. 35 minutes
• f. 5.8 minutes
• g. 0.25
• h. 0.5
• i. 1
• j. 43 minutes
• k. 40 minutes
• l. 0.3333

## Exercise 6

According to a study by Dr. John McDougall of his live-in weight loss program at St. Helena Hospital, the people who follow his program lose between 6 and 15 pounds a month until they approach trim body weight. Let’s suppose that the weight loss is uniformly distributed. We are interested in the weight loss of a randomly selected individual following the program for one month. (Source: The McDougall Program for Maximum Weight Loss by John A. McDougall, M.D.)

• a. Define the random variable. X = X = size 12{X={}} {}
• b. X ~ X ~ size 12{X "~" } {}
• c. Graph the probability distribution.
• d. f ( x ) = f ( x ) = size 12{f $$x$$ ={}} {}
• e. μ = μ = size 12{μ={}} {}
• f. σ = σ = size 12{σ={}} {}
• g. Find the probability that the individual lost more than 10 pounds in a month.
• h. Suppose it is known that the individual lost more than 10 pounds in a month. Find the probability that he lost less than 12 pounds in the month.
• i. P ( 7 < x < 13 x > 9 ) = P ( 7 < x < 13 x > 9 ) = size 12{P $$7<X<"13" \lline X>9$$ ={}} {} __________. State this in a probability question (similar to g and h), draw the picture, and find the probability.

## Exercise 7

A subway train on the Red Line arrives every 8 minutes during rush hour. We are interested in the length of time a commuter must wait for a train to arrive. The time follows a uniform distribution.

• a. Define the random variable. X = X = size 12{X={}} {}
• b. X ~ X ~ size 12{X "~" } {}
• c. Graph the probability distribution.
• d. f ( x ) = f ( x ) = size 12{f $$x$$ ={}} {}
• e. μ = μ = size 12{μ={}} {}
• f. σ = σ = size 12{σ={}} {}
• g. Find the probability that the commuter waits less than one minute.
• h. Find the probability that the commuter waits between three and four minutes.
• i. 60% of commuters wait more than how long for the train? State this in a probability question (similar to g and h), draw the picture, and find the probability.

### Solution

• b. X ~ U ( 0,8 ) X ~ U ( 0,8 ) size 12{X "~" U $$0,8$$ } {}
• d. f(x)=18f(x)=18 where 0x80x8
• e. 4
• f. 2.31
• g. 1818
• h. 1818
• i. 3.2

## Exercise 8

The age of a first grader on September 1 at Garden Elementary School is uniformly distributed from 5.8 to 6.8 years. We randomly select one first grader from the class.

• a. Define the random variable. X = X = size 12{X={}} {}
• b. X ~ X ~ size 12{X "~" } {}
• c. Graph the probability distribution.
• d. f ( x ) = f ( x ) = size 12{f $$x$$ ={}} {}
• e. μ = μ = size 12{μ={}} {}
• f. σ = σ = size 12{σ={}} {}
• g. Find the probability that she is over 6.5 years.
• h. Find the probability that she is between 4 and 6 years.
• i. Find the 70th percentile for the age of first graders on September 1 at Garden Elementary School.

## Exercise 9

Let X~X~ size 12{X "~" } {}Exp(0.1)

• a. decay rate=
• b. μ = μ = size 12{μ={}} {}
• c. Graph the probability distribution function.
• d. On the above graph, shade the area corresponding to P(x<6)P(x<6) size 12{P $$X<6$$ } {} and find the probability.
• e. Sketch a new graph, shade the area corresponding to P(3<x<6)P(3<x<6) size 12{P $$3<X<6$$ } {} and find the probability.
• f. Sketch a new graph, shade the area corresponding to P(x>7)P(x>7) size 12{P $$X>7$$ } {} and find the probability.
• g. Sketch a new graph, shade the area corresponding to the 40th percentile and find the value.
• h. Find the average value of xx size 12{X} {}.

• a. 0.1
• b. 10
• d. 0.4512
• e. 0.1920
• f. 0.4966
• g. 5.11
• h. 10

## Exercise 10

Suppose that the length of long distance phone calls, measured in minutes, is known to have an exponential distribution with the average length of a call equal to 8 minutes.

• a. Define the random variable. X = X = size 12{X={}} {}
• b. Is XX size 12{X} {} continuous or discrete?
• c. X ~ X ~ size 12{X "~" } {}
• d. μ = μ = size 12{μ={}} {}
• e. σ = σ = size 12{σ={}} {}
• f. Draw a graph of the probability distribution. Label the axes.
• g. Find the probability that a phone call lasts less than 9 minutes.
• h. Find the probability that a phone call lasts more than 9 minutes.
• i. Find the probability that a phone call lasts between 7 and 9 minutes.
• j. If 25 phone calls are made one after another, on average, what would you expect the total to be? Why?

## Exercise 11

Suppose that the useful life of a particular car battery, measured in months, decays with parameter 0.025. We are interested in the life of the battery.

• a. Define the random variable. X = X = size 12{X={}} {}
• b. Is XX size 12{X} {} continuous or discrete?
• c. X ~ X ~ size 12{X "~" } {}
• d. On average, how long would you expect 1 car battery to last?
• e. On average, how long would you expect 9 car batteries to last, if they are used one after another?
• f. Find the probability that a car battery lasts more than 36 months.
• g. 70% of the batteries last at least how long?

### Solution

• c. X ~ Exp ( 0.025 ) X ~ Exp ( 0.025 ) size 12{X "~" "Exp" $${ {1} over {5} }$$ } {}
• d. 40 months
• e. 360 months
• f. 0.4066
• g. 14.27

## Exercise 12

The percent of persons (ages 5 and older) in each state who speak a language at home other than English is approximately exponentially distributed with a mean of 9.848 . Suppose we randomly pick a state. (Source: Bureau of the Census, U.S. Dept. of Commerce)

• a. Define the random variable. X = X = size 12{X={}} {}
• b. Is XX size 12{X} {} continuous or discrete?
• c. X ~ X ~ size 12{X "~" } {}
• d. μ = μ = size 12{μ={}} {}
• e. σ = σ = size 12{σ={}} {}
• f. Draw a graph of the probability distribution. Label the axes.
• g. Find the probability that the percent is less than 12.
• h. Find the probability that the percent is between 8 and 14.
• i. The percent of all individuals living in the United States who speak a language at home other than English is 13.8 .
• i. Why is this number different from 9.848%?
• ii. What would make this number higher than 9.848%?

## Exercise 13

The time (in years) after reaching age 60 that it takes an individual to retire is approximately exponentially distributed with a mean of about 5 years. Suppose we randomly pick one retired individual. We are interested in the time after age 60 to retirement.

• a. Define the random variable. X = X = size 12{X={}} {}
• b. Is XX size 12{X} {} continuous or discrete?
• c. X ~ X ~ size 12{X "~" } {}
• d. μ = μ = size 12{μ={}} {}
• e. σ = σ = size 12{σ={}} {}
• f. Draw a graph of the probability distribution. Label the axes.
• g. Find the probability that the person retired after age 70.
• h. Do more people retire before age 65 or after age 65?
• i. In a room of 1000 people over age 80, how many do you expect will NOT have retired yet?

### Solution

• c. X ~ Exp ( 1 5 ) X ~ Exp ( 1 5 ) size 12{X "~" "Exp" $${ {1} over {5} }$$ } {}
• d. 5
• e. 5
• g. 0.1353
• h. Before
• i. 18.3

## Exercise 14

The cost of all maintenance for a car during its first year is approximately exponentially distributed with a mean of $150. • a. Define the random variable. X = X = size 12{σ={}} {} • b. X ~ X ~ size 12{X "~" } {} • c. μ = μ = size 12{μ={}} {} • d. σ = σ = size 12{σ={}} {} • e. Draw a graph of the probability distribution. Label the axes. • f. Find the probability that a car required over$300 for maintenance during its first year.

## Try these multiple choice problems

The next three questions refer to the following information. The average lifetime of a certain new cell phone is 3 years. The manufacturer will replace any cell phone failing within 2 years of the date of purchase. The lifetime of these cell phones is known to follow an exponential distribution.

### Exercise 15

The decay rate is

• A. 0.3333
• B. 0.5000
• C. 2.0000
• D. 3.0000

A

### Exercise 16

What is the probability that a phone will fail within 2 years of the date of purchase?

• A. 0.8647
• B. 0.4866
• C. 0.2212
• d. 0.9997

B

### Exercise 17

What is the median lifetime of these phones (in years)?

• A. 0.1941
• B. 1.3863
• C. 2.0794
• D. 5.5452

#### Solution

C

The next three questions refer to the following information. The Sky Train from the terminal to the rental car and long term parking center is supposed to arrive every 8 minutes. The waiting times for the train are known to follow a uniform distribution.

### Exercise 18

What is the average waiting time (in minutes)?

• A. 0.0000
• B. 2.0000
• C. 3.0000
• D. 4.0000

D

### Exercise 19

Find the 30th percentile for the waiting times (in minutes).

• A. 2.0000
• B. 2.4000
• C. 2.750
• D. 3.000

B

### Exercise 20

The probability of waiting more than 7 minutes given a person has waited more than 4 minutes is?

• A. 0.1250
• B. 0.2500
• C. 0.5000
• D. 0.7500

B

## Content actions

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

#### Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

#### Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks


text:
Course Outline

• segmentGetting Started (Don't Skip This Part)
• segmentStatistics and Data Science: A Modeling Approach
• segmentPART I: EXPLORING VARIATION
• segmentChapter 1 - Welcome to Statistics: A Modeling Approach
• segmentChapter 2 - Understanding Data
• segmentChapter 3 - Examining Distributions
• segmentChapter 4 - Explaining Variation
• segmentPART II: MODELING VARIATION
• segmentChapter 5 - A Simple Model
• segmentChapter 6 - Quantifying Error
• segmentChapter 7 - Adding an Explanatory Variable to the Model
• segmentChapter 8 - Digging Deeper into Group Models
• segmentChapter 9 - Models with a Quantitative Explanatory Variable
• segmentPART III: EVALUATING MODELS
• segmentChapter 10 - The Logic of Inference
• segmentChapter 11 - Model Comparison with F
• segmentChapter 12 - Parameter Estimation and Confidence Intervals
• segmentFinishing Up (Don't Skip This Part!)
• segmentResources

list High School / Advanced Statistics and Data Science I (ABC)

Book
• High School / Advanced Statistics and Data Science I (ABC)
• High School / Statistics and Data Science I (AB)
• High School / Statistics and Data Science II (XCD)
• College / Statistics and Data Science (ABC)
• College / Advanced Statistics and Data Science (ABCD)
• College / Accelerated Statistics and Data Science (XCDCOLLEGE)

We have developed the idea of the mean being the simplest (or empty) model of the distribution of a quantitative variable, represented in this word equation:

DATA = MEAN + ERROR

If this is true, then we can calculate error in our data set by just moving components of this equation around to get the formula:

ERROR = DATA - MEAN

Using this formula, if someone has a thumb length larger than the mean (e.g., 62 versus a mean of 60.1), then their error is a positive number (in this case, nearly +2). If they have a thumb length lower than the mean (e.g., 58) then we can calculate their error as a negative number (e.g. about -2).

We generally call the error calculated this way as the residual. Now that you know how to generate predictions, we’ll refine our definition of the residual to be the difference between our model’s prediction and an actual observed score. The word residual should evoke the stuff that remains because the residual is the leftover variation from our data once we take out the model.

To find these errors (or residuals) you can just subtract the mean from each data point. In R we could just run this code to get the residuals:

Fingers$Thumb - Fingers$Predict

If we run the code, R will calculate the 157 residuals, but it won’t save them unless we tell it to do so. Modify the code in the window below to save the residuals in a new variable in Fingers called Resid. (Note that the variable Predict already exists in the Fingers data frame).

require(coursekata) Fingers$TinySet <- c(1,1,1,0,0,0,1,0,0,1, rep(0,147)) Fingers$TinySet[142] <- 1 Fingers <- arrange(arrange(Fingers, Height), desc(TinySet)) empty_model <- lm(Thumb ~ NULL, data = Fingers) Fingers <- Fingers %>% mutate( Predict = predict(empty_model), Resid = Thumb - Predict ) # modify this to save the residuals from the empty_model Fingers$Resid <- # this prints selected variables from Fingers select(Fingers, Thumb, Predict, Resid) Fingers$Resid <- Fingers$Thumb - Fingers$Predict ex() %>% check_object("Fingers") %>% check_column("Resid") %>% check_equal()
CK Code: B1_Code_Thinking_01
 Thumb  Predict     Resid
1    52 60.10366 -8.103662
2    56 60.10366 -4.103662
3    64 60.10366  3.896338
4    70 60.10366  9.896338
5    66 60.10366  5.896338
6    62 60.10366  1.896338

These residuals (or “leftovers”) are so important in modeling that there is an even easier way to get them in R. The function resid(), when given a model (e.g., empty_model) will return all the residuals from the predictions of the model.

resid(empty_model)

Modify the following code to save the residuals that we get using the resid() function as a variable in the Fingers data frame. Call the new variable EasyResid.

require(coursekata) Fingers$TinySet <- c(1,1,1,0,0,0,1,0,0,1, rep(0,147)) Fingers$TinySet[142] <- 1 Fingers <- arrange(arrange(Fingers, Height), desc(TinySet)) empty_model <- lm(Thumb ~ NULL, data = Fingers) Fingers <- Fingers %>% mutate( Predict = predict(empty_model), Resid = Thumb - Predict ) # calculate the residuals from empty_model the easy way # and save them in the Fingers data frame Fingers$EasyResid <- # this prints select variables from Fingers head(select(Fingers, Thumb, Predict, Resid, EasyResid)) Fingers$EasyResid <- resid(empty_model) Fingers ex() %>% check_object("Fingers") %>% check_column("EasyResid") %>% check_equal()
CK Code: Code_Thinking_02
 Thumb  Predict     Resid EasyResid
1    52 60.10366 -8.103662 -8.103662
2    56 60.10366 -4.103662 -4.103662
3    64 60.10366  3.896338  3.896338
4    70 60.10366  9.896338  9.896338
5    66 60.10366  5.896338  5.896338
6    62 60.10366  1.896338  1.896338

Notice that the values for Resid and EasyResid are the same for each row in the data set. We will generally use the resid() function from now on, just because it’s easier, but we want you to know what the resid() function is doing behind the scenes.

Below we have plotted a few of the residuals from the Fingers data set on the Thumb by Height scatterplot. Visually, the residuals can be thought of as the vertical distance between the data (the students’ actual thumb lengths) and the model’s predicted thumb length (60.1).

Note that sometimes the residuals are negative (extending below the empty model) and sometimes positive (above the empty model). Because the empty model is the mean, we know that these residuals are perfectly balanced across the full data set of 157 students.

Distribution of Residuals

Below we’ve plotted histograms of the three variables: Thumb, Predict, and Resid.

The distributions of the data and the residuals have the same shape. But the numbers on the x-axis differ across the two distributions. The distribution of Thumb is centered at the mean (60.1), whereas the distribution of Resid is centered at 0. Data that are smaller than the mean (such as a thumb length of 50) have negative residuals (-10) but data that are larger than the mean (such as 70) have positive residuals (10).

Let’s see what we would get if we summed all values for the variable Fingers$Resid. Try it in the code block below. require(coursekata) empty_model <- lm(Thumb ~ NULL, data = Fingers) Fingers <- Fingers %>% mutate( Predict = predict(empty_model), Resid = resid(empty_model) ) # assume Fingers data frame already has the variable Resid saved in it sum(Fingers$Resid) ex() %>% { check_output_expr(., "sum(Fingers\$Resid)") }
CK Code: Code_Thinking_03
1.70530256582424e-13

R will sometimes give you outputs in scientific notation. The 1.7e-13 is equivalent to $$1.7*10^{-13}$$ which indicates that this is a number very close to zero (the -13 meaning that that decimal point is shifted to the left 13 places)! Whenever you see this scientific notation with a large negative exponent after the “e”, you can just read it as “zero,” or pretty close to zero.

The residuals (or error) around the mean always sum to 0. The mean of the errors will also always be 0, because 0 divided by n equals 0. (R will not always report the sum as exactly 0 because of computer hardware limitations but it will be close enough to 0.)


text:
Permutation with circular arrangement

by Andrei Lenedin   Last Updated July 12, 2019 07:20 AM

In how many ways can 5 men and 5 women be arranged, if two particular women must not be next to a particular man?

May anyone explain why the answer is 864:

If the separated man $$O$$ is the starting point and the separated women $$W_1,W_2$$ are to choose any seat except the two seats beside $$O$$, so they would have 7 seats to choose from, implying $$P^7_2$$ arrangements. Then the other men and women would have $$P^4_4 P^3_3$$ choices respectively. Therefore the total arrangements would be $$P^4_4 \times P^3_3 \times P^7_2$$, however my logic is incorrect since the actual answer is $$P^4_4 \times P^3_3 \times P^3_2$$ but this suggests $$W_1,W_2$$ only have 3 seats to choose instead of 7, why is it so?

Tags :

Related Questions

Updated March 27, 2017 01:20 AM

Updated June 01, 2019 04:20 AM

Updated July 22, 2017 15:20 PM

Updated May 30, 2019 15:20 PM

Updated December 05, 2018 20:20 PM


text:
Summer is Coming! Join the Game of Timers Competition to Win Epic Prizes. Registration is Open. Game starts Mon July 1st.

 It is currently 17 Jul 2019, 03:56

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# Two dice, each with six sides numbered 1 through 6, are tossed. What

Author Message
TAGS:

### Hide Tags

Math Expert
Joined: 02 Sep 2009
Posts: 56268
Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

13 Nov 2018, 01:26
2
6
00:00

Difficulty:

45% (medium)

Question Stats:

45% (00:57) correct 55% (00:55) wrong based on 132 sessions

### HideShow timer Statistics

Two dice, each with six sides numbered 1 through 6, are tossed. What is the probability that both dice will come up with either a 1 or a 2 ?

A. 1/36

B. 1/18

C. 1/9

D. 1/3

E. 2/3

_________________
GMAT Club Legend
Joined: 18 Aug 2017
Posts: 4237
Location: India
Concentration: Sustainability, Marketing
GPA: 4
WE: Marketing (Energy and Utilities)
Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

Updated on: 20 Dec 2018, 07:48
1
Bunuel wrote:
Two dice, each with six sides numbered 1 through 6, are tossed. What is the probability that both dice will come up with either a 1 or a 2 ?

A. 1/36

B. 1/18

C. 1/9

D. 1/3

E. 2/3

either 1 or 2 in first dice : 2/6
Either 1 or 2 in second dice : 2/6

2/6*2/6=1/9 option c
_________________
If you liked my solution then please give Kudos. Kudos encourage active discussions.

Originally posted by Archit3110 on 13 Nov 2018, 04:07.
Last edited by Archit3110 on 20 Dec 2018, 07:48, edited 2 times in total.
Manager
Joined: 20 Jun 2018
Posts: 73
Location: India
Re: Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

13 Nov 2018, 09:19
both dice coming up with the number 1 - 1/6*1/6=1/36

both dice coming up with number 2 - 1/6*1/6=1/36

Since it is an 'OR' problem we need to add them both so 1/36+1/36=2/36=1/18

_________________
PLEASE GIVE KUDOS IF YOU WERE ABLE TO SOLVE THE QUESTION. THANK YOU.
e-GMAT Representative
Joined: 04 Jan 2015
Posts: 2942
Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

13 Nov 2018, 21:16

Solution

Given:
• Two dice, each with six sides numbered 1 through 6, are tossed

To find:
• The probability that both dice will come up either 1 or 2

Approach and Working:
• P(both 1) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P(both 2) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P( a 1 and a 2) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P( a 2 and a 1) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$

Thus, P( either 1 or 2) = $$\frac{1}{36} + \frac{1}{36} + \frac{1}{36} + \frac{1}{36} = \frac{4}{36} = \frac{1}{9}$$

Hence, the correct answer is Option C

_________________
Manager
Joined: 20 Jun 2018
Posts: 73
Location: India
Re: Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

13 Nov 2018, 22:01
EgmatQuantExpert wrote:

Solution

Given:
• Two dice, each with six sides numbered 1 through 6, are tossed

To find:
• The probability that both dice will come up either 1 or 2

Approach and Working:
• P(both 1) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P(both 2) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P( a 1 and a 2) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P( a 2 and a 1) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$

Thus, P( either 1 or 2) = $$\frac{1}{36} + \frac{1}{36} + \frac{1}{36} + \frac{1}{36} = \frac{4}{36} = \frac{1}{9}$$

Hence, the correct answer is Option C

If this is the right answer then I'm afraid but the question hasn't been worded properly. It clearly mentions that the number on both dice should be either a 1 or a 2. That means both the dice should have either 1 or either 2 and not like 1 in the first and 2 in the second one.
_________________
PLEASE GIVE KUDOS IF YOU WERE ABLE TO SOLVE THE QUESTION. THANK YOU.
GMAT Club Legend
Joined: 18 Aug 2017
Posts: 4237
Location: India
Concentration: Sustainability, Marketing
GPA: 4
WE: Marketing (Energy and Utilities)
Re: Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

14 Nov 2018, 01:04
Shbm wrote:
EgmatQuantExpert wrote:

Solution

Given:
• Two dice, each with six sides numbered 1 through 6, are tossed

To find:
• The probability that both dice will come up either 1 or 2

Approach and Working:
• P(both 1) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P(both 2) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P( a 1 and a 2) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P( a 2 and a 1) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$

Thus, P( either 1 or 2) = $$\frac{1}{36} + \frac{1}{36} + \frac{1}{36} + \frac{1}{36} = \frac{4}{36} = \frac{1}{9}$$

Hence, the correct answer is Option C

If this is the right answer then I'm afraid but the question hasn't been worded properly. It clearly mentions that the number on both dice should be either a 1 or a 2. That means both the dice should have either 1 or either 2 and not like 1 in the first and 2 in the second one.

Shbm : I also got the question wrong , the wording of this question is not clear.
_________________
If you liked my solution then please give Kudos. Kudos encourage active discussions.
Intern
Joined: 29 Dec 2014
Posts: 23
Schools: IMD '21 (S)
Re: Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

14 Nov 2018, 01:24
Either 1 or 2 means

1,2
2,1
1,1
2,2

So 4/36

Posted from my mobile device
Manager
Joined: 20 Jun 2018
Posts: 73
Location: India
Re: Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

14 Nov 2018, 05:58
Archit3110 wrote:
Shbm wrote:
EgmatQuantExpert wrote:

Solution

Given:
• Two dice, each with six sides numbered 1 through 6, are tossed

To find:
• The probability that both dice will come up either 1 or 2

Approach and Working:
• P(both 1) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P(both 2) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P( a 1 and a 2) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$
• P( a 2 and a 1) = $$\frac{1 * 1}{6 * 6} = \frac{1}{36}$$

Thus, P( either 1 or 2) = $$\frac{1}{36} + \frac{1}{36} + \frac{1}{36} + \frac{1}{36} = \frac{4}{36} = \frac{1}{9}$$

Hence, the correct answer is Option C

If this is the right answer then I'm afraid but the question hasn't been worded properly. It clearly mentions that the number on both dice should be either a 1 or a 2. That means both the dice should have either 1 or either 2 and not like 1 in the first and 2 in the second one.

Shbm : I also got the question wrong , the wording of this question is not clear.

yea same for me. However, don't worry such a poorly worded question wouldn't appear on the GMAT.
_________________
PLEASE GIVE KUDOS IF YOU WERE ABLE TO SOLVE THE QUESTION. THANK YOU.
Senior Manager
Joined: 24 Oct 2016
Posts: 482
GMAT 1: 670 Q46 V36
GMAT 2: 690 Q47 V38
Re: Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

15 Nov 2018, 19:52
Bunuel wrote:
Two dice, each with six sides numbered 1 through 6, are tossed. What is the probability that both dice will come up with either a 1 or a 2 ?

A. 1/36

B. 1/18

C. 1/9

D. 1/3

E. 2/3

Possible Cases:
1,1
1,2
2,1
2,2
Therefore, 4 possible cases.
Total cases = 6 x 6 = 36
Probability = 4/36 = 1/9
_________________

If you found my post useful, KUDOS are much appreciated. Giving Kudos is a great way to thank and motivate contributors, without costing you anything.
CEO
Joined: 12 Sep 2015
Posts: 3847
Re: Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

20 Dec 2018, 07:43
1
Top Contributor
Bunuel wrote:
Two dice, each with six sides numbered 1 through 6, are tossed. What is the probability that both dice will come up with either a 1 or a 2 ?

A. 1/36

B. 1/18

C. 1/9

D. 1/3

E. 2/3

P(both dice will come up with either a 1 or a 2) = P(1st die is 1 or 2 AND 2nd die is 1 or 2)
= P(1st die is 1 or 2) x P(2nd die is 1 or 2)
= 2/6 x 2/6
= 1/3 x 1/3
= 1/9

Cheers,
Brent
_________________
Test confidently with gmatprepnow.com
Manager
Joined: 13 Nov 2018
Posts: 62
Location: United States (PA)
GMAT 1: 650 Q39 V40
GMAT 2: 660 Q44 V37
GPA: 2.91
Re: Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

20 Dec 2018, 15:38
would it be correct to say that each dice has a 1/3 chance of getting a desired number so...

1/3*1/3 = 1/9?
Target Test Prep Representative
Status: Founder & CEO
Affiliations: Target Test Prep
Joined: 14 Oct 2015
Posts: 6923
Location: United States (CA)
Re: Two dice, each with six sides numbered 1 through 6, are tossed. What  [#permalink]

### Show Tags

27 Feb 2019, 10:25
1
Bunuel wrote:
Two dice, each with six sides numbered 1 through 6, are tossed. What is the probability that both dice will come up with either a 1 or a 2 ?

A. 1/36

B. 1/18

C. 1/9

D. 1/3

E. 2/3

Since each die has 6 outcomes, there are a total of 6 x 6 = 36 outcomes when two dice are rolled.

Of these 36 outcomes, (1, 1), (1, 2), (2, 1) and (2, 2) are the only ones in which both dice show either a 1 or a 2. Therefore, the probability is 4/36 = 1/9.

_________________

# Scott Woodbury-Stewart

Founder and CEO

Scott@TargetTestPrep.com
122 Reviews

5-star rated online GMAT quant
self study course

See why Target Test Prep is the top rated GMAT quant course on GMAT Club. Read Our Reviews

If you find one of my posts helpful, please take a moment to click on the "Kudos" button.

Re: Two dice, each with six sides numbered 1 through 6, are tossed. What   [#permalink] 27 Feb 2019, 10:25
Display posts from previous: Sort by


text:
Image of Element under Inverse Mapping

Theorem

Let $S$ and $T$ be sets.

Let $f: S \to T$ be a mapping such that its inverse $f^{-1}: T \to S$ is also a mapping.

Then:

$\forall x \in S, y \in T: \map f x = y \iff \map {f^{-1} } y = x$

Proof

Sufficient Condition

Let $f: S \to T$ be a mapping.

From the definition of inverse mapping:

$f^{-1} = \set {\tuple {y, x}: \tuple {x, y} \in f}$

Let $y = f \paren x$.

From the definition of the preimage of an element:

$\map {f^{-1} } y = \set {s \in S: \tuple {y, x} \in f}$

Thus:

$x \in \map {f^{-1} } y$

However, $f^{-1}$ is a mapping.

Therefore, by definition:

$\forall y \in T: \tuple {y, x_1} \in f^{-1} \land \tuple {y, x_2} \in f^{-1} \implies x_1 = x_2$

Thus:

$\forall s \in f^{-1} \paren y: s = x$

Thus:

$\map {f^{-1} } y = \set x$

That is:

$x = \map {f^{-1} } y$

$\Box$

Necessary Condition

Let $\map {f^{-1} } y = x$.

By definition of inverse mapping:

$\map f x = y$

$\blacksquare$


text:
# §20.7 Identities

## §20.7(i) Sums of Squares

20.7.1
20.7.2
20.7.3
20.7.4

Also

20.7.5

20.7.6
20.7.7
20.7.8
20.7.9

For these and similar formulas see Lawden (1989, §1.4), Whittaker and Watson (1927, pp. 487–488), and Carlson (2011, §5).

Also, in further development along the lines of the notations of Neville (§20.1) and of Glaisher (§22.2), the identities (20.7.6)–(20.7.9) have been recast in a more symmetric manner with respect to suffices . The symmetry, applicable also to §§20.7(iii) and 20.7(vii), is obtained by modifying traditional theta functions in the manner recommended by Carlson (2011) and used for further purposes by Fukushima (2012).

20.7.10

## §20.7(iv) Reduction Formulas for Products

20.7.11
20.7.12

Addendum: For a companion equation see (20.7.34).

20.7.13
20.7.14

With

20.7.15

Next, with

20.7.20

## §20.7(vii) Derivatives of Ratios of Theta Functions

See Lawden (1989, pp. 19–20). This reference also gives the eleven additional identities for the permutations of the four theta functions.


text:
# Electrical Quantity Division Principles

#### CompTIA Network+ Certification (N10-007)

Best Seller

172 Lectures 23 hours

#### Network sockets and streaming (C# based)

16 Lectures 1.5 hours

#### Network+ (N10-007): The Complete Course

45 Lectures 14 hours

In this chapter, let us discuss about the following two division principles of electrical quantities.

• Current Division Principle
• Voltage Division Principle

## Current Division Principle

When two or more passive elements are connected in parallel, the amount of current that flows through each element gets divided (shared) among themselves from the current that is entering the node.

Consider the following circuit diagram.

The above circuit diagram consists of an input current source IS in parallel with two resistors R1 and R2. The voltage across each element is VS. The currents flowing through the resistors R1 and R2 are I1 and I2 respectively.

The KCL equation at node P will be

$$I_S = I_1 + I_2$$

• Substitute $I_1 = \frac{V_S}{R_1}$ and $I_2 = \frac{V_S}{R_2}$ in the above equation.

$$I_S = \frac{V_S}{R_1} + \frac{V_S}{R_2} = V_S \lgroup \frac {R_2 + R_1 }{R_1 R_2} \rgroup$$

$$\Rightarrow V_S = I_S \lgroup \frac{R_1R_2}{R_1 + R_2} \rgroup$$

• Substitute the value of VS in $I_1 = \frac{V_S}{R_1}$.

$$I_1 = \frac{I_S}{R_1}\lgroup \frac{R_1 R_2}{R_1 + R_2} \rgroup$$

$$\Rightarrow I_1 = I_S\lgroup \frac{R_2}{R_1 + R_2} \rgroup$$

• Substitute the value of VS in $I_2 = \frac{V_S}{R_2}$.

$$I_2 = \frac{I_S}{R_2} \lgroup \frac{R_1 R_2}{R_1 + R_2} \rgroup$$

$$\Rightarrow I_2 = I_S \lgroup \frac{R_1}{R_1 + R_2} \rgroup$$

From equations of I1 and I2, we can generalize that the current flowing through any passive element can be found by using the following formula.

$$I_N = I_S \lgroup \frac{Z_1\rVert Z_2 \rVert...\rVert Z_{N-1}}{Z_1 + Z_2 + ... + Z_N}\rgroup$$

This is known as current division principle and it is applicable, when two or more passive elements are connected in parallel and only one current enters the node.

Where,

• IN is the current flowing through the passive element of Nth branch.

• IS is the input current, which enters the node.

• Z1, Z2, …,ZN are the impedances of 1st branch, 2nd branch, …, Nth branch respectively.

## Voltage Division Principle

When two or more passive elements are connected in series, the amount of voltage present across each element gets divided (shared) among themselves from the voltage that is available across that entire combination.

Consider the following circuit diagram.

The above circuit diagram consists of a voltage source, VS in series with two resistors R1 and R2. The current flowing through these elements is IS. The voltage drops across the resistors R1 and R2 are V1 and V2 respectively.

The KVL equation around the loop will be

$$V_S = V_1 + V_2$$

• Substitute V1 = IS R1 and V2 = IS R2 in the above equation

$$V_S = I_S R_1 + I_S R_2 = I_S(R_1 + R_2)$$

$$I_S = \frac{V_S}{R_1 + R_2}$$

• Substitute the value of IS in V1 = IS R1.

$$V_1 = \lgroup \frac {V_S}{R_1 + R_2} \rgroup R_1$$

$$\Rightarrow V_1 = V_S \lgroup \frac {R_1}{R_1 + R_2} \rgroup$$

• Substitute the value of IS in V2 = IS R2.

$$V_2 = \lgroup \frac {V_S}{R_1 + R_2} \rgroup R_2$$

$$\Rightarrow V_2 = V_S \lgroup \frac {R_2}{R_1 + R_2} \rgroup$$

From equations of V1 and V2, we can generalize that the voltage across any passive element can be found by using the following formula.

$$V_N = V_S \lgroup \frac {Z_N}{Z_1 + Z_2 +....+ Z_N}\rgroup$$

This is known as voltage division principle and it is applicable, when two or more passive elements are connected in series and only one voltage available across the entire combination.

Where,

• VN is the voltage across Nth passive element.

• VS is the input voltage, which is present across the entire combination of series passive elements.

• Z1,Z2, …,Z3 are the impedances of 1st passive element, 2nd passive element, …, Nth passive element respectively.


text:
# More output neurons than labels?

When we train a neural network model for a classification problem, we usually have a dense output layer of size equal to the number of labels we have.

If the layer size was greater, the model can still be trained and have output

How can we interpret such output? are there any applications for this?

• Are you looking for a solution for the target which is not yet introduced but probably will come in furlturw? – vipin bansal Jul 16 '19 at 13:38
• @vipinbansal not really – Abdulrahman Bres Jul 16 '19 at 13:58

One kind-of similar case are the advantage actor-critic networks commonly used in reinforcement learning. The ultimate goal of a reinforcement-learning agent is to choose an action from a set of $$n$$ possible actions, so traditionally we might try a network with $$n$$ outputs. Actor critic methods actually have $$n+1$$ outputs. The first $$n$$ choose an action, and the "extra" neuron tries to estimate the value of the chosen action.


text:
# Ex.8.3 Q8 Comparing Quantities Solutions - NCERT Maths Class 8

Go back to  'Ex.8.3'

## Question

Find the amount and the compound interest on $$\rm{Rs}\, 10,000$$ for (1\begin{align}\frac{1}{2})\end{align} years at $$10\%$$ per annum, compounded half yearly. Would this interest be more than the interest he would get if it was compounded annually?

Video Solution
Comparing Quantities
Ex 8.3 | Question 8

## Text Solution

What is known?

Principal, Time Period and Rate of Interest

What is unknown?

Amount and Compound Interest (C.I.)

Reasoning:

\begin{align}{A = P}\left( {{1 + }\frac{{r}}{{{100}}}} \right)^{\rm{n}}\end{align}

$$P=\rm{Rs}\, 10,000$$

N= (1\begin{align}\frac{1}{2})\end{align} years

$$R= 10\%$$ p.a. compounded annually and half-yearly

Steps:

For calculation of C.I. compounded half yearly, we will take Interest rate as $$5\%$$

\begin{align}A &= P\left( {{1 + }\frac{{r}}{{{100}}}} \right)^{n} \\ &= 10000\left( {{1 + }\frac{{5}}{{{100}}}} \right)^{3} \\ &= 10000\left( {{1 + }\frac{{1}}{{{20}}}} \right)^{3} \\ & = 10000\left( {\frac{{21}}{{20}}} \right)^3 \\ &= 10000\times \frac{{21}}{{20}} \times \frac{{21}}{{20}} \times \frac{{21}}{{20}} \\ &= 10000 \times \frac{{9261}}{{8000}} \\ &= {5} \times \frac{{9261}}{4} \\ &= 11576.25 \\ \end{align}

Interest earned at $$10\%$$ p.a. compounded half-yearly $$= 11576.25 \,– \,10000=\rm{Rs}\, 1576.25$$

The amount earned at $$10\%$$ p.a. compounded half-yearly $$= 11576.25$$

The C.I. earned at $$10\%$$ p.a. compounded half-yearly $$= 1576.25$$

The above interest earned being compounded half-yearly would be more than the interest compounded annually since interest compounded half yearly is always more than compounded annually at the same rate of interest.

Learn from the best math teachers and top your exams

• Live one on one classroom and doubt clearing
• Practice worksheets in and after class for conceptual clarity
• Personalized curriculum to keep up with school


text:
# T is onto $\mathbb R^m$ iff the columns of A span

i need to proof why $T$ is onto $\mathbb R^m$ iff the columns of $A$ span if the columns are Linearly independent $T$ is onto..

-
It's not clear to me what your question is - iff the columns of $A$ span what? Also, what is $T$ and what is $A$. –  Joe Tait Mar 18 '13 at 17:37
I think he means that $T$ is given by an $m\times n$ matrix, and he needs to show that it is onto $\mathbb{R}^m$ iff the columns of $A$ span $\mathbb{R}^m$. But yes, a little more effort and clarity would be nice... –  Lepidopterist Mar 18 '13 at 17:44
It's useful to realize that a matrix times a vector, $Tx$, can be represented as $$Tx=x^{(1)}t_1+x^{(2)}t_2+\cdots+x^{(n)}t_n.$$Here $t_i$ represents the i-th column of $T$ and $x^{(i)}$ the i-th component of the vector $x$. Can you finish the proof knowing this?