url stringlengths 6 1.61k | fetch_time int64 1,368,856,904B 1,726,893,854B | content_mime_type stringclasses 3 values | warc_filename stringlengths 108 138 | warc_record_offset int32 9.6k 1.74B | warc_record_length int32 664 793k | text stringlengths 45 1.04M | token_count int32 22 711k | char_count int32 45 1.04M | metadata stringlengths 439 443 | score float64 2.52 5.09 | int_score int64 3 5 | crawl stringclasses 93 values | snapshot_type stringclasses 2 values | language stringclasses 1 value | language_score float64 0.06 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
http://web2.0calc.com/questions/hey_82223 | 1,508,213,494,000,000,000 | text/html | crawl-data/CC-MAIN-2017-43/segments/1508187820700.4/warc/CC-MAIN-20171017033641-20171017053641-00126.warc.gz | 460,633,782 | 5,780 | +0
# hey
0
40
1
In May (31 days), the loan payment is 603 €, out of which the capital portion is 51,0 % and the rest is interest for the loan capital. Calculate the annual interest rate, when after the payment the remaining balance is 61660 €.
Guest Mar 8, 2017
Sort:
### 1+0 Answers
#1
0
In May (31 days), the loan payment is 603 €, out of which the capital portion is 51,0 % and the rest is interest for the loan capital. Calculate the annual interest rate, when after the payment the remaining balance is 61660 €.
603 x 51% =307.53 - This the principal portion of the payment.
603 x 49% =295.47 - This is the interest portion of the payment.
61,660 + 307.53 =61,967.53 - This is the balance of the before the principal payment.
295.47 / 31(days in May) =9.53 - This is daily interest on the loan.
9.53/61,967.53 =0.000153811 - This is the DAILY interest rate.
0.000153811 x 365 x 100 =5.6141% - This is the interest RATE componded daily.
5.6141% compounded daily =5.7742% - EFFECTIVE annual interest rate
Guest Mar 8, 2017
### 10 Online Users
We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners. See details | 367 | 1,296 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.40625 | 3 | CC-MAIN-2017-43 | longest | en | 0.916591 |
https://us.metamath.org/mpeuni/df-lco.html | 1,721,666,045,000,000,000 | text/html | crawl-data/CC-MAIN-2024-30/segments/1720763517890.5/warc/CC-MAIN-20240722160043-20240722190043-00215.warc.gz | 498,435,907 | 4,664 | Mathbox for Alexander van der Vekens < Previous Next > Nearby theorems Mirrors > Home > MPE Home > Th. List > Mathboxes > df-lco Structured version Visualization version GIF version
Definition df-lco 44811
Description: Define the operation constructing the set of all linear combinations for a set of vectors. (Contributed by AV, 31-Mar-2019.) (Revised by AV, 28-Jul-2019.)
Assertion
Ref Expression
df-lco LinCo = (𝑚 ∈ V, 𝑣 ∈ 𝒫 (Base‘𝑚) ↦ {𝑐 ∈ (Base‘𝑚) ∣ ∃𝑠 ∈ ((Base‘(Scalar‘𝑚)) ↑m 𝑣)(𝑠 finSupp (0g‘(Scalar‘𝑚)) ∧ 𝑐 = (𝑠( linC ‘𝑚)𝑣))})
Distinct variable group: 𝑚,𝑐,𝑠,𝑣
Detailed syntax breakdown of Definition df-lco
StepHypRef Expression
1 clinco 44809 . 2 class LinCo
2 vm . . 3 setvar 𝑚
3 vv . . 3 setvar 𝑣
4 cvv 3441 . . 3 class V
52cv 1537 . . . . 5 class 𝑚
6 cbs 16475 . . . . 5 class Base
75, 6cfv 6324 . . . 4 class (Base‘𝑚)
87cpw 4497 . . 3 class 𝒫 (Base‘𝑚)
9 vs . . . . . . . 8 setvar 𝑠
109cv 1537 . . . . . . 7 class 𝑠
11 csca 16560 . . . . . . . . 9 class Scalar
125, 11cfv 6324 . . . . . . . 8 class (Scalar‘𝑚)
13 c0g 16705 . . . . . . . 8 class 0g
1412, 13cfv 6324 . . . . . . 7 class (0g‘(Scalar‘𝑚))
15 cfsupp 8817 . . . . . . 7 class finSupp
1610, 14, 15wbr 5030 . . . . . 6 wff 𝑠 finSupp (0g‘(Scalar‘𝑚))
17 vc . . . . . . . 8 setvar 𝑐
1817cv 1537 . . . . . . 7 class 𝑐
193cv 1537 . . . . . . . 8 class 𝑣
20 clinc 44808 . . . . . . . . 9 class linC
215, 20cfv 6324 . . . . . . . 8 class ( linC ‘𝑚)
2210, 19, 21co 7135 . . . . . . 7 class (𝑠( linC ‘𝑚)𝑣)
2318, 22wceq 1538 . . . . . 6 wff 𝑐 = (𝑠( linC ‘𝑚)𝑣)
2416, 23wa 399 . . . . 5 wff (𝑠 finSupp (0g‘(Scalar‘𝑚)) ∧ 𝑐 = (𝑠( linC ‘𝑚)𝑣))
2512, 6cfv 6324 . . . . . 6 class (Base‘(Scalar‘𝑚))
26 cmap 8389 . . . . . 6 class m
2725, 19, 26co 7135 . . . . 5 class ((Base‘(Scalar‘𝑚)) ↑m 𝑣)
2824, 9, 27wrex 3107 . . . 4 wff 𝑠 ∈ ((Base‘(Scalar‘𝑚)) ↑m 𝑣)(𝑠 finSupp (0g‘(Scalar‘𝑚)) ∧ 𝑐 = (𝑠( linC ‘𝑚)𝑣))
2928, 17, 7crab 3110 . . 3 class {𝑐 ∈ (Base‘𝑚) ∣ ∃𝑠 ∈ ((Base‘(Scalar‘𝑚)) ↑m 𝑣)(𝑠 finSupp (0g‘(Scalar‘𝑚)) ∧ 𝑐 = (𝑠( linC ‘𝑚)𝑣))}
302, 3, 4, 8, 29cmpo 7137 . 2 class (𝑚 ∈ V, 𝑣 ∈ 𝒫 (Base‘𝑚) ↦ {𝑐 ∈ (Base‘𝑚) ∣ ∃𝑠 ∈ ((Base‘(Scalar‘𝑚)) ↑m 𝑣)(𝑠 finSupp (0g‘(Scalar‘𝑚)) ∧ 𝑐 = (𝑠( linC ‘𝑚)𝑣))})
311, 30wceq 1538 1 wff LinCo = (𝑚 ∈ V, 𝑣 ∈ 𝒫 (Base‘𝑚) ↦ {𝑐 ∈ (Base‘𝑚) ∣ ∃𝑠 ∈ ((Base‘(Scalar‘𝑚)) ↑m 𝑣)(𝑠 finSupp (0g‘(Scalar‘𝑚)) ∧ 𝑐 = (𝑠( linC ‘𝑚)𝑣))})
Colors of variables: wff setvar class This definition is referenced by: lcoop 44815
Copyright terms: Public domain W3C validator | 1,317 | 2,445 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.65625 | 3 | CC-MAIN-2024-30 | latest | en | 0.213605 |
https://www.daniweb.com/programming/software-development/threads/439602/ticket-sales-accumulator-issue | 1,701,369,885,000,000,000 | text/html | crawl-data/CC-MAIN-2023-50/segments/1700679100229.44/warc/CC-MAIN-20231130161920-20231130191920-00738.warc.gz | 839,419,394 | 16,262 | Hello again, I am working on a homework problem and I am not able to get the accumulator to accumulate the tickets sales for each section.
My assignment is to create a basic program that will use loops. I need to have it ask for each day of the week how many tickets were sold in each category. Also I need it to accumulate the total were sold throughout the week within each category. I played around with what I have now and it seems to only accumulate what the last day is not each day. Can someone help me figure out what I am doing wrong? Also if you have any tips for a better way of coding it I am trying to learn as much as possible. (please understand this is a fundamentals class though :P )
``````def main():
#Seat pricing per section
classA = 15
classB = 12
classC = 9
#Number of days
week = 7
#Loop to ask for and recieve user input for how many sold in each section
for sales_week in range (week):
totalA = 0
totalB = 0
totalC = 0
print('For day', sales_week+1)
print('---------')
ticketA = int(input('Enter the number of Class A seats were sold: '))
ticketB = int(input('Enter the number of Class B seats were sold: '))
ticketC = int(input('Enter the number of Class C seats were sold: '))
print('')
totalA += ticketA
totalB += ticketB
totalC += ticketC
seatsA(classA, totalA)
seatsB(classB, totalB)
seatsC(classC, totalC)
grand_total = totalA + totalB + totalC
print('The total of all seats sold is: ', grand_total)
#Fuctions to calculate the totals
def seatsA(price, seats):
classA_Total = price * seats
print('\$', classA_Total, ' in Class A seats were sold.', sep='')
def seatsB(price, seats):
classB_Total = price * seats
print('\$', classB_Total, ' in Class B seats were sold.', sep='')
def seatsC(price, seats):
classC_Total = price * seats
print('\$', classC_Total, ' in Class C seats were sold.', sep='')
main()
``````
## All 4 Replies
What happens to total variables when for loop advances to next iteration?
Do I need to add a nested loop and have them within the inner loop?
Here is an example of how it should be done:
``````# initial value
total_sold = 0
for x in range(3):
sold = int(input("Enter number of items sold: "))
total_sold += sold
print(total_sold) # test
``````
If you put the initial value in the loop, it would continually reset.
Ok so that did work when I took the initial total values out and put them before the loop. Can you explain why so I understand it fully.
Thank you once again Dandiweb Community!!
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge. | 673 | 2,680 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.09375 | 3 | CC-MAIN-2023-50 | latest | en | 0.957503 |
https://metanumbers.com/92953 | 1,638,729,389,000,000,000 | text/html | crawl-data/CC-MAIN-2021-49/segments/1637964363215.8/warc/CC-MAIN-20211205160950-20211205190950-00375.warc.gz | 467,559,102 | 7,347 | # 92953 (number)
92,953 (ninety-two thousand nine hundred fifty-three) is an odd five-digits composite number following 92952 and preceding 92954. In scientific notation, it is written as 9.2953 × 104. The sum of its digits is 28. It has a total of 4 prime factors and 8 positive divisors. There are 79,380 positive integers (up to 92953) that are relatively prime to 92953.
## Basic properties
• Is Prime? No
• Number parity Odd
• Number length 5
• Sum of Digits 28
• Digital Root 1
## Name
Short name 92 thousand 953 ninety-two thousand nine hundred fifty-three
## Notation
Scientific notation 9.2953 × 104 92.953 × 103
## Prime Factorization of 92953
Prime Factorization 73 × 271
Composite number
Distinct Factors Total Factors Radical ω(n) 2 Total number of distinct prime factors Ω(n) 4 Total number of prime factors rad(n) 1897 Product of the distinct prime numbers λ(n) 1 Returns the parity of Ω(n), such that λ(n) = (-1)Ω(n) μ(n) 0 Returns: 1, if n has an even number of prime factors (and is square free) −1, if n has an odd number of prime factors (and is square free) 0, if n has a squared prime factor Λ(n) 0 Returns log(p) if n is a power pk of any prime p (for any k >= 1), else returns 0
The prime factorization of 92,953 is 73 × 271. Since it has a total of 4 prime factors, 92,953 is a composite number.
## Divisors of 92953
1, 7, 49, 271, 343, 1897, 13279, 92953
8 divisors
Even divisors 0 8 4 4
Total Divisors Sum of Divisors Aliquot Sum τ(n) 8 Total number of the positive divisors of n σ(n) 108800 Sum of all the positive divisors of n s(n) 15847 Sum of the proper positive divisors of n A(n) 13600 Returns the sum of divisors (σ(n)) divided by the total number of divisors (τ(n)) G(n) 304.882 Returns the nth root of the product of n divisors H(n) 6.83478 Returns the total number of divisors (τ(n)) divided by the sum of the reciprocal of each divisors
The number 92,953 can be divided by 8 positive divisors (out of which 0 are even, and 8 are odd). The sum of these divisors (counting 92,953) is 108,800, the average is 13,600.
## Other Arithmetic Functions (n = 92953)
1 φ(n) n
Euler Totient Carmichael Lambda Prime Pi φ(n) 79380 Total number of positive integers not greater than n that are coprime to n λ(n) 13230 Smallest positive number such that aλ(n) ≡ 1 (mod n) for all a coprime to n π(n) ≈ 8969 Total number of primes less than or equal to n r2(n) 0 The number of ways n can be represented as the sum of 2 squares
There are 79,380 positive integers (less than 92,953) that are coprime with 92,953. And there are approximately 8,969 prime numbers less than or equal to 92,953.
## Divisibility of 92953
m n mod m 2 3 4 5 6 7 8 9 1 1 1 3 1 0 1 1
The number 92,953 is divisible by 7.
## Classification of 92953
• Arithmetic
• Deficient
### Expressible via specific sums
• Polite
• Non-hypotenuse
• Frugal
## Base conversion (92953)
Base System Value
2 Binary 10110101100011001
3 Ternary 11201111201
4 Quaternary 112230121
5 Quinary 10433303
6 Senary 1554201
8 Octal 265431
10 Decimal 92953
12 Duodecimal 45961
20 Vigesimal bc7d
36 Base36 1zq1
## Basic calculations (n = 92953)
### Multiplication
n×y
n×2 185906 278859 371812 464765
### Division
n÷y
n÷2 46476.5 30984.3 23238.2 18590.6
### Exponentiation
ny
n2 8640260209 803138107207177 74654096479228723681 6939322230033747552319993
### Nth Root
y√n
2√n 304.882 45.2989 17.4609 9.85491
## 92953 as geometric shapes
### Circle
Diameter 185906 584041 2.71442e+10
### Sphere
Volume 3.36418e+15 1.08577e+11 584041
### Square
Length = n
Perimeter 371812 8.64026e+09 131455
### Cube
Length = n
Surface area 5.18416e+10 8.03138e+14 160999
### Equilateral Triangle
Length = n
Perimeter 278859 3.74134e+09 80499.7
### Triangular Pyramid
Length = n
Surface area 1.49654e+10 9.46507e+13 75895.8 | 1,278 | 3,828 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.5625 | 4 | CC-MAIN-2021-49 | latest | en | 0.801023 |
https://simplewebtool.com/converters/area/squaremillimicronstoares/squaremillimicronstoares.html | 1,717,060,990,000,000,000 | text/html | crawl-data/CC-MAIN-2024-22/segments/1715971059632.19/warc/CC-MAIN-20240530083640-20240530113640-00722.warc.gz | 452,292,655 | 12,407 | # Square Millimicrons to Ares conversion
## Square Millimicrons to Ares (a) conversion calculator and how to convert.
How to convert Square Millimicrons to Ares: 1 square millimicron is equal to 1e-20 ares. 1 square millimicron = (1 * 10-20) = 1e-20 a The areaQ(a) in ares is equal to the area Q(mm) in square millimeters multiplied by 1e-20.
Formula: Q(a) = Q(mm) * 1e-20
Square Millimicrons to Ares conversion table
Square Millimicrons Ares (a)
1 square millimicrons 1e-20 a
2 square millimicrons 2e-20 a
3 square millimicrons 3e-20 a
4 square millimicrons 4e-20 a
5 square millimicrons 5e-20 a
6 square millimicrons 6e-20 a
7 square millimicrons 7e-20 a
8 square millimicrons 8e-20 a
9 square millimicrons 9e-20 a
10 square millimicrons 1e-21 a | 278 | 754 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.09375 | 3 | CC-MAIN-2024-22 | latest | en | 0.520852 |
http://www.javaprogrammingforums.com/%20collections-generics/10823-bubble-sort-int-array-problem-printingthethread.html | 1,527,186,014,000,000,000 | text/html | crawl-data/CC-MAIN-2018-22/segments/1526794866733.77/warc/CC-MAIN-20180524170605-20180524190605-00615.warc.gz | 412,892,506 | 2,903 | # Bubble Sort Int Array Problem
• September 11th, 2011, 07:27 AM
thisbeme
Bubble Sort Int Array Problem
the error says int cannot be deferenced at java line 11
here is the code.
how do i fix that?
Code :
```public class SortInt { public static void sort(int cases[]) //Sorting fuction, the array of nums is passed to it { int temp; //a temp var is need to swtich the values in the array for(int i = 0; i < cases.length - 1; i++) //Start of the bubble sort, you need to take one away from { //the legnth of the array b/c you dont need to go throw the for(int j = 0; j < cases.length - 1; j++) //array that many times. Also if it whould go passt the end of { //the array in the second loop wich whould not been good. if(cases[j].compareTo(cases[j+1]) > 0) //This part checks to see if the number before it is bigger //You must use the compareTo() method of a string { //Note: chage the < opprator to > to sort from samllest to lagergets temp = cases[j]; //Sotres the value of nums[ii] in the temp var for use latter cases[j] = cases[j+1]; //puts the value of the bigger number where the lesser one was cases[j+1] = temp; //puts the value of the lesser var back in the array where the } //biger one was. } } } public static void main(String[] args) { //declares an array to be sorted int[] cases = {200000 , 300000 , 100000 ,400000 , 500000 , 750000 , 1000000, 1 , 2 , 5 ,400 ,500,750, 1000 , 5000 , 10000 , 25000 , 10 , 25 , 50 , 75, 100 , 50000 , 75000 }; System.out.println("Before sort():\n"); for(int i = 0; i < cases.length; i++) //for loop to show all the values of the array { System.out.println(cases[i]); //uses the for loop index var to slect an array entreay } sort(cases); //sends the array to the sort() fuction System.out.println("\nAfter sort():\n"); for(int i = 0; i < cases.length; i++) //for loop to show the realostes of the sorting { System.out.println(cases[i]); } } }```
• September 11th, 2011, 09:24 AM
Norm
Re: Bubble Sort Int Array Problem
Please post the full contents of the error message you get when you compile this program.
Where is the line with the error? Which is Line 11??? | 630 | 2,120 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.765625 | 3 | CC-MAIN-2018-22 | latest | en | 0.570489 |
https://gmatclub.com/forum/list-of-idioms-158163.html?kudos=1 | 1,508,563,024,000,000,000 | text/html | crawl-data/CC-MAIN-2017-43/segments/1508187824570.79/warc/CC-MAIN-20171021043111-20171021063111-00814.warc.gz | 693,337,700 | 45,850 | It is currently 20 Oct 2017, 22:17
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
Events & Promotions
Events & Promotions in June
Open Detailed Calendar
List of idioms
Author Message
TAGS:
Hide Tags
Intern
Joined: 25 May 2013
Posts: 12
Kudos [?]: 1 [0], given: 2
Show Tags
18 Aug 2013, 11:42
Hi all,
I am new to this Club and i am glad to be here!
I have a question relating to the list of idioms: I am going through the Manhattan GMAT list of idioms as well as the Aristole's.
Even if the first is more exhaustive, the latter is more clear.
Do you have any experience about both? I am wondering whether do I have to mix both.
Regards and good luck for the GMAT!
Kudos [?]: 1 [0], given: 2
Manhattan GMAT Discount Codes Magoosh Discount Codes EMPOWERgmat Discount Codes
Moderator
Joined: 01 Sep 2010
Posts: 3356
Kudos [?]: 9064 [1], given: 1154
Show Tags
18 Aug 2013, 12:30
1
KUDOS
The logic and Aristotle SC guide is the only thing to have to tackle the section.
Now the questions are more complex than before during the exam. In my opinion I suggest you to memorize only those idioms not familiar with your hear and that's it. Memorizing a bunch of idiom is useful to some extent. This is a test about logic not idioms, they are more than 15000 idioms.
As a matter of fact, if you tackle a question based on an idiom split and THEN try to not consider this split, trying to pick the right answer only from the meaning standing point: you can arrive at the same answer. the right one.
regards
_________________
Kudos [?]: 9064 [1], given: 1154
Moderator
Joined: 01 Sep 2010
Posts: 3356
Kudos [?]: 9064 [0], given: 1154
Re: R: List of idioms [#permalink]
Show Tags
19 Aug 2013, 15:46
Kudos help the community
Nexus 4 with Tapatalk
_________________
Kudos [?]: 9064 [0], given: 1154
Re: R: List of idioms [#permalink] 19 Aug 2013, 15:46
Display posts from previous: Sort by
List of idioms
Moderator: HiLine
Powered by phpBB © phpBB Group | Emoji artwork provided by EmojiOne Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®. | 709 | 2,607 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.015625 | 3 | CC-MAIN-2017-43 | latest | en | 0.918407 |
https://gocoding.org/c-program-to-add-two-integers/ | 1,675,592,018,000,000,000 | text/html | crawl-data/CC-MAIN-2023-06/segments/1674764500251.38/warc/CC-MAIN-20230205094841-20230205124841-00373.warc.gz | 286,804,696 | 51,981 | Select Page
# C Program to Add Two Integers
by | Dec 31, 2022 | C, C Programs
## Introduction
This program can be in two ways. One way is declaring and assigning the values to the variables and then calculating their sum. The other method is to declare the variables first and then the user is asked to enter two integers. Then, the sum operation is applied to both values, and the result will be displayed on the screen.
To understand this program, the learners should know about the following C programming topics:
1. Data Types in C
2. Variables, literals, and constants
3. C Programming operators
## Program
#include<stdio.h>
int main()
{
int a,b;
printf("Enter two values:\n");
scanf("%d",&a);
scanf("%d",&b);
int sum=a+b; // ‘+’ operator is used to add the values
printf("Sum of the values is %d",sum);
return 0;
## Explanation
Firstly, we declare two variables that are a, b that will store the values entered by the user.
int sum=a+b; the sum of ‘a’ and ‘b’ is calculated using the ‘+’ operator and the resultant is assigned to a new variable named ‘sum’ of int data type.
Since, ‘a’ and ‘b’ both are of integer type, thus their sum will also be an integer value. That is the reason why we declare the ‘sum’ variable of the ‘int’ type. | 313 | 1,255 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.71875 | 3 | CC-MAIN-2023-06 | longest | en | 0.864418 |
https://cs.stackexchange.com/questions/81150/determine-whether-a-variable-has-positive-influence-in-boolean-function | 1,623,996,023,000,000,000 | text/html | crawl-data/CC-MAIN-2021-25/segments/1623487635724.52/warc/CC-MAIN-20210618043356-20210618073356-00290.warc.gz | 189,423,514 | 37,660 | # Determine whether a variable has positive influence in Boolean function
Given a Boolean function $f$ over the set of variables $X =\{ x_1,...,x_n \}$, the influence of $x_i$ is defined as the probability that changing only $x_i$ on random input changes $f$.
Given a function $f$ presented in $\text{CNF}$, and a coordinate, are there any known methods for determine if the coordinate has positive influence?
• Finding all shortest implicates may deal with it. – rus9384 Sep 12 '17 at 12:01
• A variable $x_i$ has zero influence if and only if the function doesn't depend on the variable. – Yuval Filmus Sep 12 '17 at 12:53
Given a CNF $\phi$ and a variable $x_i$, deciding whether $\phi$ depends on $x_i$ is NP-complete. It is clearly in NP: all we need to verify that $\phi$ depends on $x_i$ is two inputs different on $x_i$ on which $\phi$ evaluates to different values.
In the other direction, we reduce from SAT. Given a CNF $\psi = C_1 \land \cdots \land C_m$, let $x$ be a new variable and consider the CNF $\phi = \psi \land x$. If $\psi$ is satisfiable then $\phi$ depends on $x$, since substituting such a satisfying assignment reduces $\phi$ to $x$. If $\psi$ is not satisfiable then $\phi$ is always false, and in particular doesn't depend on $x$.
• Well, this also gives a hint how to reduce it to SAT. Just make a formula $(\varphi\land x_i)\oplus(\varphi\land\overline{x_i})$. – rus9384 Sep 12 '17 at 19:01 | 403 | 1,425 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.765625 | 4 | CC-MAIN-2021-25 | latest | en | 0.799559 |
https://www.physicsforums.com/threads/reverse-engineering-derivations-how.591469/ | 1,576,001,729,000,000,000 | text/html | crawl-data/CC-MAIN-2019-51/segments/1575540528490.48/warc/CC-MAIN-20191210180555-20191210204555-00225.warc.gz | 810,650,817 | 15,399 | # Reverse Engineering Derivations - How?
1. Homework Statement
I have to reverse engineer a derivation in a paper and have no idea where to even start. The amount of terms are overwhelming and I can't imagine how the author even began.
2. Homework Equations
The following equations are known:
http://img7.imagebanana.com/img/jpfqw5qj/Selection_001.png
http://img7.imagebanana.com/img/v4cx2e07/Selection_009.png
http://img6.imagebanana.com/img/ape27n0j/Selection_002.png
Substituting them into the following equation gives an expression where $r$ needs to be isolated.
http://img6.imagebanana.com/img/gayq1jb5/Selection_008.png
The author makes many substitutions and results in the following simplified equation.
http://img6.imagebanana.com/img/5gmnl628/Selection_007.png
The substitutions are as follows:
http://img6.imagebanana.com/img/36qfovp8/Selection_004.png
http://img6.imagebanana.com/img/iinwallf/Selection_005.png
http://img7.imagebanana.com/img/japtx4e8/Selection_006.png
What I'm trying to do is figure out how he arrived at these coefficients [a], , [c], V, etc.
3. The Attempt at a Solution
I've substituted (1)--(5) into (6) but don't know where to go from here. The equation is huge and has many terms. I'm not sure how/where to begin.
Any help will be much appreciated. Thanks. | 344 | 1,309 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.9375 | 3 | CC-MAIN-2019-51 | latest | en | 0.936973 |
https://getrevising.co.uk/diagrams/statistical_analysis | 1,529,710,124,000,000,000 | text/html | crawl-data/CC-MAIN-2018-26/segments/1529267864822.44/warc/CC-MAIN-20180622220911-20180623000911-00421.warc.gz | 617,300,962 | 14,065 | # Statistical Analysis
HideShow resource information
• Statistical Analysis
• Mean
• Sum of all the data divided by the number of values
• Can't be too trusted because varience is not depicted by the mean. Groups with similar means can have a completely different set of data
• Deviation
• Difference between data point and mean
• Standard deviation:
• Small Standard Deviation- data is clustered around mean
• High Standars Deviation- data is widely spread above/below mean
• Error Bars
• show range of data/standard deviation
• Normal Distribution
• Bell shaped
• depends on mean or standard deviation
• T Test
• formal test for a statistical significant difference between the means of 2 sets of data
• To apply the T Test
• Data must be normally distributed
• Sample size must be greater than or equal to 10
• Correlation and Causation
• The existence of a correlation does not necessarily mean there is a causal relationship | 204 | 930 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.53125 | 3 | CC-MAIN-2018-26 | latest | en | 0.841183 |
https://community.smartsheet.com/discussion/61961/formula-assistance | 1,725,743,372,000,000,000 | text/html | crawl-data/CC-MAIN-2024-38/segments/1725700650920.0/warc/CC-MAIN-20240907193650-20240907223650-00295.warc.gz | 163,112,006 | 104,517 | # Formula Assistance
edited 12/09/19
Hi All
A newbie to Smartsheets, so please bear with me.
I have a formula that works on excel but not on Smartsheets….any ideas why?
Excel: =IF(K44="Approved",SUM(F43-C44),IF(K44="Declined",F43))
Smartsheets: =if([Approver approval]43="Approved",sum([Days Remaining]42-[Annual Leave]43,if([Approver approval]43="Declined",[Days Remaining42)))
Thanks Kim
Tags:
• ✭✭✭✭✭✭
=if([Approver approval]43="Approved",sum([Days Remaining]42-[Annual Leave]43,if([Approver approval]43="Declined",[Days Remaining42)))
your sum is not the correct reference. it is currently
sum([Days Remaining]42-[Annual Leave]43
it should be
sum([Days Remaining]42:[Annual Leave]43)
you have a minus instead of a colon and don't close out the sum. your end formula should be:
=if([Approver approval]43="Approved",sum([Days Remaining]42:[Annual Leave]43),if([Approver approval]43="Declined",[Days Remaining]42
*You also incorrectly referenced the days remaining 42 at the very end of your code. you missed your hard bracket.
• ✭✭✭✭✭✭
Got cloudflared on the edit. Anyways I took a look back at your picture you posted and I made a mistake on the sum. you don't need the sum formula, that is for a range, you just want to add two cells together then just add them.
=if([Approver approval]43="Approved",[Days Remaining]42+[Annual Leave]43,if([Approver approval]43="Declined",[Days Remaining]42
• edited 11/06/19
L@123
Thank you so much. Worked a treat
## Help Article Resources
Want to practice working with formulas directly in Smartsheet?
Check out the Formula Handbook template! | 454 | 1,609 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.71875 | 3 | CC-MAIN-2024-38 | latest | en | 0.80755 |
http://www.acmerblog.com/hdu-3336-count-the-string-5268.html | 1,503,359,276,000,000,000 | text/html | crawl-data/CC-MAIN-2017-34/segments/1502886109682.23/warc/CC-MAIN-20170821232346-20170822012346-00164.warc.gz | 452,935,635 | 12,804 | 2014
03-16
# Count the string
It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example:
s: "abab"
The prefixes are: "a", "ab", "aba", "abab"
For each prefix, we can count the times it matches in s. So we can see that prefix "a" matches twice, "ab" matches twice too, "aba" matches once, and "abab" matches once. Now you are asked to calculate the sum of the match times for all the prefixes. For "abab", it is 2 + 2 + 1 + 1 = 6.
The answer may be very large, so output the answer mod 10007.
The first line is a single integer T, indicating the number of test cases.
For each case, the first line is an integer n (1 <= n <= 200000), which is the length of string s. A line follows giving the string s. The characters in the strings are all lower-case letters.
The first line is a single integer T, indicating the number of test cases.
For each case, the first line is an integer n (1 <= n <= 200000), which is the length of string s. A line follows giving the string s. The characters in the strings are all lower-case letters.
1
4
abab
6
i~j之间已经不可能有以j结尾的子串是前缀了,不然next【j】就不是 i 了
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <iostream>
using namespace std;
const int N = 200005;
char a[N];
int next[N],d[N];
void get_next(char *b)
{
int i = -1, j = 0;
next[0] = -1;
int len = strlen(b);
while(j < len)
{
if(i == -1 || b[i] == b[j])
next[++j] = ++i;
else
i = next[i];
}
}
int main()
{
int T,i,n;
scanf("%d",&T);
while(T--)
{
scanf("%d%s",&n,a);
get_next(a);
for(i = 1; i <= n; i ++)
d[i] = 1;
d[0] = 0;
int sum = 0;
for(i = 1; i <= n; i ++)
{
d[i] = d[next[i]] + 1;
sum += d[i]%10007;
}
printf("%d\n",sum%10007);
}
return 0;
}
1. 老实说,这种方法就是穷举,复杂度是2^n,之所以能够AC是应为题目的测试数据有问题,要么数据量很小,要么能够得到k == t,否则即使n = 30,也要很久才能得出结果,本人亲测
2. bottes vernies blanches
I appreciate the efforts you men and women place in to share blogs on such sort of matters, it was certainly useful. Keep Posting!
3. #include <cstdio>
int main() { | 688 | 2,093 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.40625 | 3 | CC-MAIN-2017-34 | longest | en | 0.669066 |
https://reviewgamezone.com/preview.php?id=10402 | 1,516,595,704,000,000,000 | text/html | crawl-data/CC-MAIN-2018-05/segments/1516084890991.69/warc/CC-MAIN-20180122034327-20180122054327-00120.warc.gz | 778,284,022 | 4,755 | # Physical Properties: Question Preview (ID: 10402)
### Below is a preview of the questions contained within the game titled PHYSICAL PROPERTIES: Answer The Review Questions And Fill Out Your Study Guide. To play games using this data set, follow the directions below. Good luck and have fun. Enjoy! [print these questions]
Density is calculated by dividing the ______________ by the _______________.
a) volume, area
b) mass, weight
c) volume, mass
d) mass, volume
Which of the following can be defined as the amount of matter contained in an object?
a) mass
b) weight
c) density
d) volume
Which of the following is an example of a physical property?
a) rusting
b) density
c) toxicity
d) flammability
Which of the following is a characteristic of matter you can detect with just your sense?
a) physical property
b) mass
c) chemical property
d) density
A diamond has a density of 3.5 g/cm3. What is the mass of a diamond with a volume of 0.3 cm3?
a) 11 g
b) 1.2 g
c) 1.05 g
d) 0.086 g
Bone has a density of 1.8 g/cm3. What mass of bone is required for a bone graft involving 6.0 cm3 of bone tissue?
a) 0.3 g
b) 3.3g
c) 4.2g
d) 10.8 g
If a piece of copper has a density of 13.29 g/cm3 and a volume of 25 cm, what is the mass of the liquid?
a) 325 g
b) 1.88g
c) 0.5316 g
d) 332.25 g
Which of the following is always true when a substance undergoes a physical change?
a) the composition changes
b) a change in color occurs
c) no new substance is formed
d) its specific gravity remains the same
If 1.3 grams of air has a volume of 1000 cm3, what is the density of air?
a) 1300 g/cm3
b) 1001.3 gcm3
c) 769.23 g/cm3
d) 0.0013 g/cm3
Which of the following is an example of an irreversible physical change?
a) boiling soup
b) burning wood
c) melting ice
d) cutting an apple
Play Games with the Questions above at ReviewGameZone.com
To play games using the questions from the data set above, visit ReviewGameZone.com and enter game ID number: 10402 in the upper right hand corner at ReviewGameZone.com or simply click on the link above this text.
TEACHERS / EDUCATORS | 609 | 2,070 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.75 | 3 | CC-MAIN-2018-05 | latest | en | 0.831607 |
http://www.techdias.com/2014/02/circuits-current-divider.html | 1,548,324,670,000,000,000 | text/html | crawl-data/CC-MAIN-2019-04/segments/1547584520525.90/warc/CC-MAIN-20190124100934-20190124122934-00465.warc.gz | 388,341,908 | 40,206 | ### Digital Clock On LCD (16x2) PIC16F1937 Used In FlowCode Programming and Simulation
In this sample project we are using FlowCode Simulation Software for Programming and Testing with PIC16F1937.It shows how to use and simulate and program LCD for use in different projects.In this Project we have created digital clock(Using two digit each for seconds minute and hours in 24 Hour format on LCD) on 16x2 Liquid Crystal Display.Varying the delay and write-erase sequence can be manipulated to get desired result.
Here is the Flow code program:
LCD(16x2) Display Related Programs
ADC-Voltage as String (LCD with PIC16F1937)
ADC Sampling and outputting to a LCD(LCD with PIC16F1937)
Printing Number on 16x2 LCD Display with PIC16F88
Printing and Updating Number on 16x2 LCD Display
Printing a Two line(String) message (LCD 16x2)
Printing a formatted number on ( LCD 16x2 ) Using PIC16F88
LCD (Liquid Crystal Display 16X2):-
Its screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very…
### Current Divider in Electronic Circuit
Circuits-Current Divider
Current Divider is a simple linear circuit or device which divides the total input current to various paths or loads in fractions of the input current.It can be used to divide the input current in fractions to various branches on the device in a certain ratio.
Current Divider Circuit:
A current divider circuit is a circuit which divides the input current to various branches in a certain ratio. A simple arrangement of two or more resistors in parallel can be considered as a current divider Circuit. A current divider circuit contains various impedance in parallel.
Current Divider Rule:
The Current Divider Rule is the rule which determines how much Current flows through each branch in a current divider.
The general form of the Current Divider Rule is:
Where ,
= The current flowing through the required branch.
= Total Current flowing through the current divider or the array of resistors.
= The Total resistance of the current divider or the array of resistors.
= Resistance of the required branch.
Proof:
Let us consider following current divider with two resistors in parallel:
Here,
= Total Resistance of the current divider = =
And ,
Now Taking,
Thus,
And Similarly:
Now , Let us consider following current divider with three resistors in parallel:
Here,
= Total Resistance of the current divider = =
And ,
Now Taking,
Thus,
And Similarly:
,
Note: A Current Divider is not equivalent to a Current Regulator and is designed for a specific purpose or circuit so is Circuit or Purpose dependent.
1. Please Update this Post some of Pics are not showing.Please look into this.
### Digital Clock On LCD (16x2) PIC16F1937 Used In FlowCode Programming and Simulation
In this sample project we are using FlowCode Simulation Software for Programming and Testing with PIC16F1937.It shows how to use and simulate and program LCD for use in different projects.In this Project we have created digital clock(Using two digit each for seconds minute and hours in 24 Hour format on LCD) on 16x2 Liquid Crystal Display.Varying the delay and write-erase sequence can be manipulated to get desired result.
Here is the Flow code program:
LCD(16x2) Display Related Programs
ADC-Voltage as String (LCD with PIC16F1937)
ADC Sampling and outputting to a LCD(LCD with PIC16F1937)
Printing Number on 16x2 LCD Display with PIC16F88
Printing and Updating Number on 16x2 LCD Display
Printing a Two line(String) message (LCD 16x2)
Printing a formatted number on ( LCD 16x2 ) Using PIC16F88
LCD (Liquid Crystal Display 16X2):-
Its screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very…
### INDEX-Tutorials for Flow Code Programming and Simulation
Categorized Topics
We are using Flow Code Simulation Software from MATRIX for Programming and Testing,You will find topics from Flow Code Programming and Simulation.You can request a topic here.If some links are not working please let me know.
Flowcode is one of the world's most advanced graphical programming languages for micro-controllers. The great advantage of Flowcode is that it allows those with little to no programming experience to create complex electronic systems in minutes. Flowcode is available in multiple languages and currently supports the PICmicro, dsPIC, PIC24, AVR/Arduino and ARM series of micro controllers.You can Download the Demo Software HERE.
INDEX
Seven Segment LED Display
Using Seven Segment with PIC16F88Counting using loops(Seven Segment with PIC16F88)Counting switch presses(Seven Segment with PIC16F88)
Timers and Counters
Timed Counter And Use of Timer Interrupt(PIC16F88)
ADC Simulation In Flow CodeServo with ADC control input ,Flow Code Simulati…
### Fibonacci Series Using Array And For Loop - C Programming Examples
As we have started C Programming coding with Example Series, We have published last posts
"Write A Program For SUM of Infinite HP"
"Write A Program To Find SUM of AP" and
"Write A Program To Find SUM of GP Sequence".
In this post we are doing again Fibonacci Series but with different approach.In last post "Fibonacci Progression Using While Loop" you will see how to generate Fibonacci Numbers by using concepts of Do-While Loop.In this post we will talk about another loop i.e. For Loop and side by side Concept of Arrays will be discussed and demonstrated.
Fibonacci Series - Sequence ( Using Array And For Loop ) Video Tutorial(See C- Codes Below ):
For Loop Concept: FOR Loops are the most useful type. The syntax for a for loop is for ( variable init…
### Stepper motor Control using switches(Flow Code Simulation)
Stepper motor Control using switches(Flow Code Simulation)
Controlling Stepper motor using switches is shown here.This simulation is good technique which can be used to detect performance of your stepper beforehand.I have used unipolar configuration for motor which is versatile mode of operation.
You may also like :
Stepper motor Control using switches
Pulse Widht Modulation Simulation with Microcontrollers (PIC16F877)
Here is the complete list of projects:
Tutorials for Flow Code Programming and Simulation
### Fibonacci Numbers Series Progression Using While Loop - C Programming Examples
As we have started C Programming coding with Example Series, We have published last posts
"Write A Program For SUM of Infinite HP"
"Write A Program To Find SUM of AP" and
"Write A Program To Find SUM of GP Sequence".
Fibonacci Numbers Progression - Series - Sequence to Nth Term Step-wise Video Tutorial(See C- Codes Below ):
Fibonacci Sequence:-The Fibonacci Sequence is the series of numbers:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...The next number is found by adding up the two numbers before it.
The 2 is found by adding the two numbers before it (1+1).Similarly, the 3 is found by adding the two numbers before it (1+2),And the 5 is (2+3),and so on!
### Motor Types- Special Types of Motor
Motor Types- Special Types of Motor
1. Iron less or core-less rotor motorNothing in the principle of any of the motors described above requires that the iron (steel) portions of the rotor actually rotate. If the soft magnetic material of the rotor is made in the form of a cylinder, then (except for the effect of hysteresis) torque is exerted only on the windings of the electromagnets. Taking advantage of this fact is the core less or iron less DC motor, a specialized form of a PM DC motor. Optimized for rapid acceleration, these motors have a rotor that is constructed without any iron core. The rotor can take the form of a winding-filled cylinder, or a self-supporting structure comprising only the magnet wire and the bonding material. The rotor can fit inside the stator magnets; a magnetically soft stationary cylinder inside the rotor provides a return path for the stator magnetic flux.
### Timed Counter And Use of Timer Interrupt Using PIC16F88 Microcontroller - Flow Code Simulation
Flow Code-Timed Counter And Use of Timer Interrupt(PIC16F88)
In this example of counting seconds using Timed Counter and Timer Interrupt.In this example we are using 7 Segment Display to display the results of calculation as seen in the examples code and videos.
Here is the MACRO for Interrupt Program Code:
Here is the Flow code MAIN program:
Complete list of projects:
Tutorials for Flow Code Programming and Simulation
### LCD Interfacing With Keypad PIC16F877A FlowCode Microcontroller Programming And Simulation
In this sample project we are using Programming Software FlowCode for Programming LCD ( Liquid Crystal Display ) With Keypad and Testing And Interfacing with PIC16F877A.It shows how to use and simulate and program Keypad with LCD for use in different projects.In this Project we are testing Keypad and outputting binary values to LCD ( Liquid Crystal Display ).Varying the delay and write-erase sequence can be manipulated to get desired result.
Above is the Flow code program Snapshot:
Recent Related Programs
Keypad and LED Interfacing With PIC16F88
LCD(16x2) Display Related Programs
Voltage as Float(LCD with PIC16F1937)
Voltage as String (LCD with PIC16F1937)
ADC Sampling and outputting to a LCD
Number on 16x2 LCD Display with PIC16F88
Printing and Updating Number on 16x2 LCD Display
Two line(String) message (LCD 16x2)
Printing a formatted number on ( LCD 16x2 )
OutPut On LCD Dispaly And LED Strip is as Given.This data is Further Used for Interfacing in other big and complicated Projects
### Printing and Updating Number on 16x2 LCD Display with PIC16F88 -Flowcode Simulation Tutorials
Using FlowCode Simulation Software for Programming and Testing with PIC16F88.It shows how to use and simulate and program LCD for use in different projects.In this Project we are trying to print number on 16x2 LCD Display,and then we will try to overwrite the numbers.
Flow code program:
LCD(16x2) Display
ADC-Voltage as Float(LCD with PIC16F1937)ADC-Voltage as String (LCD with PIC16F1937)ADC Sampling and outputting to a LCD(LCD with PIC16F1937)Printing Number on 16x2 LCD Display with PIC16F88Printing a Two line(String) message (LCD 16x2) PIC16F88
### Stepper Motors Examples with PIC16F88 -Flowcode Simulation
We are using FlowCode Simulation Software for Programming and Testing with PIC16F88 for Simulation of this project .It shows how to use and simulate and program Stepper Motors for use in different projects.
For concept of Different types of Motors and their properties please see:
Motor Types-Introduction
Motor Types- DC Motor
Motor Types- AC Motor
Motor Types- Special Types of Motor
Servo Motors
Here is the Flow code program:
Three Stepper are used to depict different configurations in which they can be used .Here functionality of auto off capability is used.It can be programmed to moved back to its original position if required.
More related Post :
Stepper motor Control using switches(Flow Code Simulation)
Stepper with switch control- Auto Off with PIC16F88
Here is the complete list of projects:
Tutorials for Flow Code Programming and Simulation | 2,493 | 11,160 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.390625 | 3 | CC-MAIN-2019-04 | latest | en | 0.824652 |
https://support.nag.com/numeric/nl/nagdoc_27.1/clhtml/c02/c02akc.html | 1,709,305,722,000,000,000 | text/html | crawl-data/CC-MAIN-2024-10/segments/1707947475311.93/warc/CC-MAIN-20240301125520-20240301155520-00316.warc.gz | 545,161,960 | 4,672 | # NAG CL Interfacec02akc (cubic_real)
Settings help
CL Name Style:
## 1Purpose
c02akc determines the roots of a cubic equation with real coefficients.
## 2Specification
#include
void c02akc (double u, double r, double s, double t, double zeror[], double zeroi[], double errest[], NagError *fail)
The function may be called by the names: c02akc, nag_zeros_cubic_real or nag_cubic_roots.
## 3Description
c02akc attempts to find the roots of the cubic equation
$uz3 + rz2 + sz + t = 0 ,$
where $u,r,s$ and $t$ are real coefficients with $u\ne 0$. The roots are located by finding the eigenvalues of the associated 3 by 3 (upper Hessenberg) companion matrix2 $H$ given by
$H = ( 0 0 -t / u 1 0 -s / u 0 1 -r / u ) .$
Further details can be found in Section 9.
To obtain the roots of a quadratic equation, c02alc can be used.
## 4References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
## 5Arguments
1: $\mathbf{u}$double Input
On entry: $u$, the coefficient of ${z}^{3}$.
Constraint: ${\mathbf{u}}\ne 0.0$.
2: $\mathbf{r}$double Input
On entry: $r$, the coefficient of ${z}^{2}$.
3: $\mathbf{s}$double Input
On entry: $s$, the coefficient of $z$.
4: $\mathbf{t}$double Input
On entry: $t$, the constant coefficient.
5: $\mathbf{zeror}\left[3\right]$double Output
6: $\mathbf{zeroi}\left[3\right]$double Output
On exit: ${\mathbf{zeror}}\left[i-1\right]$ and ${\mathbf{zeroi}}\left[i-1\right]$ contain the real and imaginary parts, respectively, of the $i$th root.
7: $\mathbf{errest}\left[3\right]$double Output
On exit: ${\mathbf{errest}}\left[i-1\right]$ contains an approximate error estimate for the $i$th root.
8: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
## 6Error Indicators and Warnings
NE_C02_NOT_CONV
The iterative procedure used to determine the eigenvalues has failed to converge.
NE_C02_OVERFLOW
The companion matrix $H$ cannot be formed without overflow.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_REAL
On entry, ${\mathbf{u}}=0.0$.
Constraint: ${\mathbf{u}}\ne 0.0$.
## 7Accuracy
If ${\mathbf{fail}}\mathbf{.}\mathbf{code}=\mathrm{NE_NOERROR}$ on exit, then the $i$th computed root should have approximately $|{\mathrm{log}}_{10}\left({\mathbf{errest}}\left[i-1\right]\right)|$ correct significant digits.
## 8Parallelism and Performance
c02akc is not threaded in any implementation.
The method used by the function consists of the following steps, which are performed by functions from LAPACK.
1. (a)Form $H$.
2. (b)Apply a diagonal similarity transformation to $H$ (to give ${H}^{\prime }$).
3. (c)Calculate the eigenvalues and Schur factorization of ${H}^{\prime }$.
4. (d)Calculate the left and right eigenvectors of ${H}^{\prime }$.
5. (e)Estimate reciprocal condition numbers for all the eigenvalues of ${H}^{\prime }$.
6. (f)Calculate approximate error estimates for all the eigenvalues of ${H}^{\prime }$ (using the 1-norm).
## 10Example
To find the roots of the cubic equation
$z 3 + 3 z 2 + 9 z - 13 = 0 .$
### 10.1Program Text
Program Text (c02akce.c)
### 10.2Program Data
Program Data (c02akce.d)
### 10.3Program Results
Program Results (c02akce.r) | 1,060 | 3,393 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 41, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.671875 | 3 | CC-MAIN-2024-10 | latest | en | 0.624637 |
https://www.vedantu.com/exams/kcet-previous-year-question-paper-2014 | 1,721,901,047,000,000,000 | text/html | crawl-data/CC-MAIN-2024-30/segments/1720763857355.79/warc/CC-MAIN-20240725084035-20240725114035-00332.warc.gz | 881,761,061 | 33,174 | Courses
Courses for Kids
Free study material
Offline Centres
More
Store
# KCET 2014 Previous Year Question Paper for Maths, Physics, Chemistry & Biology
Last updated date: 25th Jul 2024
Total views: 704.7k
Views today: 14.04k
## Karnataka CET Question Paper - Year 2014
• Lakhs of students from Karnataka aim to pursue engineering/medical courses within the state-level government/private institutions. CET Exam 2014 works as an opportunity in this regard.
• Vedantu is a successful learning program that has been helping millions of candidates from all over the world and assisting them to get admission into their dream college.
• If you are the one willing to achieve your goal by preparing for the KCET exam under our highly experienced faculties, you are welcome to our studying program.
• Our subject matter experts have solved CET Exam 2014 Question Papers that are at par with the latest KCET exam pattern. Kindly go through the solutions provided below.
## Karnataka CET Question Paper - Year 2014
### KCET 2014 Maths Question Paper
Q1: in a Class With a Strength of 60 Students, There is the Following Data:
1. 25 students play cricket
2. 30 students play tennis
3. 10 students play both cricket and tennis
Find the number of students who don’t play either of the games.
Options:
1. 0
2. 35
3. 45
4. 25
Explanation: By Venn Diagram, we get our answer as 25.
Q2: Determine the area of the region bounded by two parabolas y = x2 and x = y2.
Options
1. ⅓
2. 4
3. ¼
4. 3
Explanation: Referring to the following figure, we get the area of the region covered by two parabolas as ⅓ sq unit.
### KCET 2014 Physics Question Paper
Q1: What Will Be the Revolution of Earth’s Satellite If We Ignore Its Height Above the Surface of the Earth?
Options:
1. 85 minutes
2. 156 minutes
3. 90 minutes
4. 87.73 minutes
Q2: on Attaching a 10 Kg Metal Block to a Spring (having K = 1000n/m), it Is Displaced from Its Equilibrium Position by 10 cm and Released. Determine It’s Maximum Acceleration.
Options:
1. 10 ms-2
2. 200 ms-2
3. 0.1 ms-2
4. 100 ms-2
Explanation: We know that angular velocity, ω =$\sqrt{ \frac{k}{m} }$ = $\sqrt{ \frac{1000}{10} }$ = 10 rad/s, and
Block’s maximum acceleration, aMAX = - ω2A = - (10)2* 0.1= - 10 ms-2
### KCET 2014 Chemistry Question Paper
Q1: If 25 cm3 Oxalic Acid Completely Neutralizes 0.064g of NaOH, Then Find the Molarity of the Oxalic Acid.
Options:
1. 0.045
2. 0.0642
3. 0.032
4. 0.015
Explanation: We know that Molarity, M = ( no of moles of solute)/(Volume of solution (in L))
=> Molarity = (0.064 x 1000)/(40 x 25)= 0.032
### Q2: When is the density of Carbon Monoxide (CO) maximum?
Options:
1. At 2 atm, & 600 K
2. At 4 atm, & 500 K
3. At 0.5 atm, & 273 K
4. At 6 atm, &1092 K
### KCET 2014 Biology Question Paper
Q1: Which One is True for the Eutrophicated Water Body?
Options:
1. High Mineral Content
2. Low Organic Content
3. High Oxygen Content
4. Rich Species Diversity
Explanation: Eutrophication is the process in which the water body becomes excessively rich in nutrients, leading to the abundant growth of plant life.
Q2: Which Among the Following Hormones Produce Anti-Inflammatory Reactions in Man and Inhibit the Immune Response Besides Its Primary Functions?
Options:
1. Thymosin
2. Erythropoietin
3. Thyrocalcitonin
4. Cortisol
Explanation: Cortisol is a type of Glucocorticoids. It is an anti-inflammatory hormone that generates anti-inflammatory reactions and oppresses the immune response.
KCET 2014 Previous Year Question Paper is available here along with Answer Keys for all the versions of PCMB Papers. Click on the link specified below:
### Benefits of Vedantu’s Solved KCET PYQP
Vedantu offers the following perks:
1. Concise Solutions to the KCET PYQP.
2. Easily downloadable Answer keys for all the versions of PCMB Question Papers are available on our website.
3. Students can interact with our faculties through live classes and get a free consultation with our doubts experts for on the spot clarification of their doubts.
4. Free Guess Papers, Sample Papers, Set of highlighted/Repetitive Questions, Answer keys and solutions are available at the bottom of these papers.
5. Attempting mocks have turned out to be the best way of self-analyzing one’s weak and strong points. Therefore, Vedantu offers you free competitive mock tests. After submission, you will be ranked based on your score among the other candidates.
6. We have a user-friendly ‘Vedantu App,' which provides all the notifications related to free live classes, free study materials, and updates related to upcoming exams.
Getting all these things mentioned above in a single-window is an opportunity for you. So, grab all these benefits and enrol yourself in our learning program. We are looking for willful candidates like you!
## FAQs on KCET 2014 Previous Year Question Paper for Maths, Physics, Chemistry & Biology
1. What is the difficulty level of the KCET Exam?
KCET Exam is a state-level exam; it is less difficult than the JEE Main Exam. However, subjects like Physics and Chemistry have high difficulty in this exam.
2. Are 12th marks important for deciding your rank in the KCET exam?
The eligibility criteria for the KCET exam is the students must have passed 12th or 2nd PUC.
The procedure for determining the candidate’s rank in the KCET Exam is listed below:
1. 50% score is taken from the marks obtained in the board exam subjects including Physics, Chemistry and Mathematics/Biology.
2. 50% score is taken from the score you gained in the KCET examination.
Hence, 50% + 50% score determines your rank in the KCET Exam.
3. What rank will I get if I score 105 in the KCET Exam and have scored 95% in board exams through PCM?
As per the latest data on the Expected cut-off in the KCET Exam 2020, if the candidate’s KCET marks lie between 100 and 110 marks range (out of 180), he/she may hold the rank between 2001-2500.
4. How can I achieve a rank below 5000 in the KCET Exam?
For achieving a rank below 5000, the following are the marks a candidate must have scored:
1. Above 90% in the 2nd PUC, and
2. 120+ in the KCET Exam. | 1,612 | 6,173 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.734375 | 4 | CC-MAIN-2024-30 | latest | en | 0.87263 |
http://studylib.net/doc/18356488/circuits-and-resistivity | 1,524,552,194,000,000,000 | text/html | crawl-data/CC-MAIN-2018-17/segments/1524125946565.64/warc/CC-MAIN-20180424061343-20180424081343-00508.warc.gz | 309,503,309 | 15,770 | ```Circuits and Resistivity
“Look for knowledge not in books but in things themselves.”
W. Gilbert
OBJECTIVES
To learn the use of several types of electrical measuring instruments in DC circuits. To
observe the I-V characteristics of some devices. To see how resistivity is measured.
THEORY
Because electrical devices and measurements are so pervasive, some knowledge of them
is essential to all technical disciplines. In this experiment we will introduce several instruments
and use them to measure the electrical characteristics of some common components and circuits.
We will also measure a fundamental property of materials, the resistivity.
Circuits
An electrical circuit is a collection of components connected together with wires to
perform a desired function. The physical realization of the circuit can vary enormously, as long
as the connections between components are correct. For this reason, circuits are usually
represented by schematic diagrams whose geometry need not resemble that of the physical
circuit at all. An amplifier, for example, might equally well be assembled from several
centimeter-sized components connected by pieces of solid copper wire, or from a micron-scale
pattern of thin metal and semiconductor films on the surface of a silicon wafer. Details of the
geometry only become important when the wavelength of the signals becomes comparable to the
circuit size, typically at frequencies of a few gigahertz.
A typical schematic diagram is shown in Fig. 1, along with a picture of one possible
realization. If you wanted to construct a circuit you would first identify the various components
A
V
+ Amps
+ Volts
Fig. 1 Circuit for measuring the I-V characteristic of a light bulb, drawn as a schematic and as a
pictorial.
A
+
-
B C
D
ICD
IAB
+
-
(a)
A
IAB
B
C
ICD
D
(b)
Fig. 2 (a) Series connection of DC supply and two resistors. Here IAB = ICD, but VAB ! VCD unless
the resistances are equal. (b) Parallel connection of two resistors across a DC supply. Now VAB =
VCD, but IAB ! ICD unless the resistances are equal.
and their connection points, using the manufacturers' data sheets if needed. You would then use
wires to systematically join each component to the others according to the lines in the schematic
drawing. The relative positions of the components need not resemble the schematic layout, but
the circuit will work if the connections are correct.
In discussing circuits, there are two general arrangements that are referred to by name, as
drawn in Fig. 2 using resistors. In the series circuit the currents IAB and ICD must always be the
same, since charge cannot accumulate between the components. The electric potential difference
between A and B, VAB, will not be the same as VCD unless the elements are identical. For the
parallel connection, the reverse is true: VAB = VCD because they are connected by a resistanceless
wire, but the currents IAB and ICD are generally different. The distinction is useful if, for example,
you want the same current to flow in two coils to generate a magnetic field. Connecting them in
series guarantees that this will occur, regardless of the characteristics of the individual coils.
Conversely, a group of devices which require the same voltage, such as light bulbs, would be
connected in parallel with the power source.
Electrical meters
The potential difference between two points in a circuit can be measured with a voltmeter
connected in parallel between the points, as shown in Fig. 3. An ideal voltmeter would have
infinite resistance so that current flow in the circuit will not be affected by the additional path
between the measuring points. Practical voltmeters, or the voltage input to a computer interface,
have resistances of 1 - 10 M!, which may affect measurements in circuits with other large
resistances.
Current flow through a specified part of the circuit is measured by inserting an ammeter
in series at the desired location, as shown in Fig. 3. An ideal ammeter would have zero resistance
so the circuit would not be affected by insertion of the meter. Depending on their design and
sensitivity, practical ammeters will add their internal resistance of 1 -10 ! into the circuit, which
Circuits and Resistivity
2
A
+
-
A
C
B
D
V
IAB
Fig. 3 Resistors connected in parallel across a DC supply. The ammeter is placed in series with
one resistor to measure IAB, while the voltmeter is placed in parallel with the other resistor to
measure VCD.
may disturb low-resistance circuits. Incidentally, their low resistance also means that if an
ammeter is connected directly across a source of voltage, such as a battery, a very large current
will flow. This is likely to damage both the source and the meter.
Meters are also available to determine DC resistance. They typically apply a known
voltage to the component to be tested and measure the resulting current, displaying the ratio as
the resistance in ohms. The component must be disconnected from the rest of the circuit to avoid
interference from currents or voltages not supplied by the meter.
I-V characteristics and resistivity
One of the most basic properties of any electrical device is the amount of current I which
flows when a known voltage V is applied to the device. A plot of the current as a function of the
voltage is usually called the I-V characteristic of the device. The I-V characteristic is often a
complicated curve, which may change as the temperature of the device changes, as light hits the
device and so on. Sometimes these changes are used to sense temperature, light level or some
other variable, but at other times any change is a nuisance. Whatever the I-V curve looks like, it
is customary to define the ratio V/I as the resistance, R, of the device at a particular current,
temperature, light level etc. When V is in volts and I in amperes, R is in ohms.
There are many situations in which the I-V curve is simply a straight line through the
origin. In other words, V = IR, where R is a constant. Such devices are said to obey Ohm’s Law,
or to be “ohmic”. If the curve is also reasonably independent of external influences the device
becomes particularly useful in electronics, and is simply called a “resistor”. For example, in later
experiments it will be convenient to use the voltage across a known resistor to infer the current in
a circuit.
Resistance depends on both the geometry of the device and the material of which it is
made. The resistivity is a more fundamental property of the material, since it is independent of
the geometry of a particular specimen. Resistivity, !, is defined by
Circuits and Resistivity
3
! = E/j
(1)
where j is the current density in response to an applied electric field E. More practically, the
measured resistance of a sample of length L and area A is related to the resistivity by
! = RA/L
(2)
This relationship assumes that the material has been shaped into a uniform cross-section and that
the current is uniformly distributed across the area.
When used in circuits, any combination of ohmic resistors is also ohmic, and could be
replaced by an equivalent single resistor. Your text derives the effective resistance of series and
parallel combinations of resistors R1 and R2, arriving at
and
Reff = R1 + R2
(series)
(3)
1
1
1
=
+
R1 R2
Reff
(parallel)
(4)
More complicated combinations can be worked out by successive applications of these two
results.
EXPERIMENTAL PROCEDURE
Your lab station is equipped with a panel of mounted components, an adjustable voltage
source, an analog ammeter, a digital multimeter and wires for easily connecting things. For this
experiment we will use only the light bulb and the resistors on the panel. Connections are made
to the terminals beside each component. The resistors are identified by their values in ohms,
using an archaic color code which is explained in Fig. 4, and posted at the front of the lab room.
The voltage source is usually referred to as a power supply. It contains circuitry which converts
household power to an adjustable DC voltage. Connections are made through the terminals on
top, and the desired output is set with the multi-turn knob. The ammeter is essentially selfexplanatory.
Figure 5 illustrates the style of DMM used in the lab, with important features labeled.
The function dial is used to select the type of measurement and sometimes the range, although
many DMMs select the scale automatically. An input terminal usually labeled COM or Common is
the reference for most measurements. The other terminals may be labeled with various
Circuits and Resistivity
4
Color
Black
Brown
Red
Orange
Yellow
Green
Blue
Violet
Gray
White
Digits
1
2
3
4
5
6
7
8
9
Multiplier
0
1
2
3
4
5
6
7
8
9
100
101
102
103
104
105
106
107
108
109
Fig. 4 The resistor color code. The last band specifies the relative accuracy of the value: Gold
±5%; Silver ±10%; No band ±20%. A 51k!, 10% resistor would be marked Green-BrownOrange-Silver.
combinations of V, A and !, indicating their use for measuring voltage, current and resistance
respectively. Wires from these terminals are connected into the circuit as needed for each
function. Additional labels on the same or other terminals may be used to denote the inputs for
other functions such as high current, high voltage, capacitance or frequency ranges when those
are present. Other controls may be provided to select a specific measurement range or to hold a
I-V measurements
The first experiment you should try is the measurement of the I-V characteristic of a
resistor. Wire up the circuit of Fig. 1, replacing the light bulb with a 150! resistor and the
battery with the power supply. Use the DMM to measure the voltage across the resistor. By
varying the output of the power supply you will vary the current through the resistor. Plot current
vs voltage as you go along to avoid the tedium of tabulating and then plotting data. Is the inverse
of the slope of your line reasonably close to 150!?
Circuits and Resistivity
5
Display shows function
units and value
HOLD
RANGE
2000
MΩ
LOGIC
μA
mA
2A
Resistance
Ω
2A
DC voltage
V
mA
AC voltage
V
DC current ranges
On/off and function
selector
AC current ranges
μA
OFF
Input for current
measurements
Input for resistance
and voltage
measurements
ΩV
COM
AmA
μA
Common input
for all functions
Fig. 5 Controls and inputs for a general-purpose DMM typical of those used in the lab.
When you finish with the resistor, replace it with the light bulb, and make a similar plot.
The resistance of the bulb varies with the temperature of the filament and the temperature varies
with the current, so we might expect some strange things to happen. Is the lamp ohmic?
Bulk resistivity
Next we will determine the electrical properties of some Play-Doh™. Because it does not
come with wires attached, we will need to make our own connections. This is a bit complicated
because chemical reactions between metal and Play-Doh may cause the contact resistance to
change as current flows. To get around this problem, we will make a “4-probe” measurement as
follows. Roll out a circular cylinder of Play-Doh, keeping the diameter as uniform as possible,
and press the ends onto the two copper plates provided. Make the specimen long and skinny so
the voltage will be big enough to measure easily. Connect the copper plates in series with the
ammeter and power supply so you can pass current through the sample. Measure the voltage
between two points a convenient distance apart on the cylinder surface, taking care not to deform
the material. Changes in resistance at these contacts cannot affect the voltmeter reading since
there is no current flow through the voltage contacts. Determine an I-V curve characteristic for
your Play-Doh cylinder, and decide whether or not Play-Doh is ohmic.
Circuits and Resistivity
6
Knowing the current, voltage and geometry you can derive the resistivity of Play-Doh
from Eq. 2. Do this for the cylinder and for some other cross-sectional shapes and areas to see if
the resistivity is indeed a constant of this material. You do not need a full I-V curve for every
shape if you already know the material is ohmic.
Resistor combinations
As a last exercise, you should use the ohmmeter capability of the DMM to check the
rules for series and parallel combinations of resistors, Eq. 3 and 4. Pick any two resistors from
the left-hand column on the panel to be R1 and R2, and measure their values with the DMM. Are
they within the specified tolerance of their marked values? Using the measured values, calculate
the effective resistances for the series and parallel combinations of the two resistors. Measure the
actual series and parallel resistances. Do the measurements agree with the calculation?
Circuits and Resistivity
7
``` | 2,897 | 12,712 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.78125 | 4 | CC-MAIN-2018-17 | latest | en | 0.927465 |
https://www.quesba.com/questions/1-why-does-the-x86-architecture-require-both-a-frame-pointer-register-and-a-39502 | 1,606,252,504,000,000,000 | text/html | crawl-data/CC-MAIN-2020-50/segments/1606141177566.10/warc/CC-MAIN-20201124195123-20201124225123-00571.warc.gz | 798,362,589 | 18,833 | # 1. Why does the x86 architecture require both a frame-pointer register and a stack-pointer register?
1. Why does the x86 architecture require both a frame-pointer register and a stack-pointer register?
2. Recursion, in the context of programming languages, refers to a function that calls itself. For example, the following is a simple example (assume that it’s called only with appropriate argument values): int factorial(int n) { if (n == 1) return n; else return n*factorial(n-1); } Tail recursion is a restriction of recursion in which the result of a recursive call is simply returned — nothing else may be done with the result. For example, here’s a tail-recursive version of the factorial function: int factorial(int n) { return f2(n, 1); } int f2(int a1, int a2) { if (a1 == 1) return a2; else return f2(a1-1, a1*a2); } a. Why is tail recursion a useful concept? (Hint: consider memory use.) b. Explain how tail recursion might be implemented so as actually to be so useful.
Mar 20 2020| 03:43 AM
## Related Questions
### Find the solutions for the following problems The prototype of a C-callable assembly function in a C
Find the solutions for the following problems The prototype of a C-callable assembly function in a C program is extern int norm_sq_asm(int *p, int n); Based on the rule of the ARM Architecture Call Standard, find which core registers are used to pass the pointer p and the integer n to the assembly function and which register used for return value of the assembly function.
Feb 18 2020
### Consider the following high-level function. // C code int f(int n, int k) { int b; b = k + 2; if...
Consider the following high-level function. // C code int f(int n, int k) { int b; b = k + 2; if (n == 0) b = 10; else b = b + (n + n) + f(n - 1, k + 1); return b +k; } (a) Translate the high-level function f into ARM assembly language. Pay particular attention to properly saving and restoring registers across function calls and using the ARM preserved register conventions. Clearly comment your...
Nov 09 2020
### 1. What happens when you use a function name, without arguments, in a print statement? What value...
1.       What happens when you use a function name, without arguments, in a print statement? What value is produced when you use the type() function on a function name? 2.       A very simple recursive function is factorial. The defi nition of factorial (written n!) says that 0! is 1, and in general n! is n * (n – 1)!. For example,...
Sep 11 2020
### 1. 2What is printed from fun(19) as coded below? Explain what the function does. 2. Write a tail...
1.       2What is printed from fun(19) as coded below? Explain what the function does. 2.       Write a tail version of the factorial function and add a no recursive function to call it. Test the function in a program.
Aug 26 2020
### Consider the following recursive algorithm for computing the sum of the following series: S(n) = 1...
Consider the following recursive algorithm for computing the sum of the following series: S(n) = 1 / 1!+ 2 / 2!+ . . . + n/n !. ALGORITHM S(n) //Input: A positive integer n // Procedure: fact (n) returns the factorial of the number passed as parameter //Output: The sum of the series: S(n) = 1 / 1!+ 2 / 2!+ . . . + n/n ! if n = 1 return 1 else return S(n - 1 ) + n/ fact (n) a. Set up and solve a...
Oct 22 2020
## Recent Questions
### 1. Now think about an encounter in which you have dealt with someone who left you feeling...
1.       Now think about an encounter in which you have dealt with someone who left you feeling satisfied and happy. What was it about this encounter that made you feel this way? 2.       Explain why professionalism is important to the pharmacy technician. Visit pharmacies in your area and observe the pharmacists and technicians working...
Nov 24 2020
### Think about a situation in which you have dealt with someone who left you feeling angry or...
Think about a situation in which you have dealt with someone who left you feeling angry or disappointed. What was it about the encounter that made you feel this way? What could have improved the outcome of the encounter?
Nov 24 2020
### __________ is a psychological defense mechanism in which confrontation with a personal problem,...
__________ is a psychological defense mechanism in which confrontation with a personal problem, or with reality, is avoided by not admitting the existence of the problem or reality. A. Sublimation B. Displacement C. Hostility D. Denial
Nov 24 2020
### ___________________ are tools an individual uses when required to deal with uncomfortable or...
___________________ are tools an individual uses when required to deal with uncomfortable or threatening situations. A. Social wrongs B. Negative communicators C. Defense mechanisms D. Conscious reactions
Nov 24 2020
### Personal and social bias, which brings about discrimination, is called: A. prejudice. B....
Personal and social bias, which brings about discrimination, is called: A. prejudice. B. unfairness. C. negative. D. confrontational.
Nov 24 2020 | 1,305 | 5,277 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.796875 | 3 | CC-MAIN-2020-50 | latest | en | 0.788935 |
https://careercadets.com/quiz/logical-reasoning-reasoning-54885 | 1,675,257,089,000,000,000 | text/html | crawl-data/CC-MAIN-2023-06/segments/1674764499934.48/warc/CC-MAIN-20230201112816-20230201142816-00874.warc.gz | 183,077,249 | 6,650 | # Logical reasoning - Reasoning quiz 2
### Logical reasoning - Reasoning Online Quiz 2
Logical reasoning - Reasoning quiz 2 is a free online quiz challenge under Logical reasoning - Reasoning category. There are 277 free online quiz challenges available in Reasoning category
Walk into any supermarket or pharmacy and you will find several shelves of products designed to protect adults and children from the sun. Additionally, a host of public health campaigns have been created, including National Skin Cancer Awareness Month, that warn us about the sun's damaging UV rays and provide guidelines about protecting ourselves. While warnings about the sun's dangers are frequent, a recent survey found that fewer than half of all adults adequately protect themselves from the sun.
This paragraph best supports the statement that.
For too long, school cafeterias, in an effort to provide food they thought would be appetizing to young people, mimicked fast-food restaurants, serving items such as burgers and fries, pizza, hot dogs, and fried chicken. School districts nationwide are now addressing this trend by incorporating some simple and inexpensive options that will make cafeteria lunches healthier while still appealing to students.
This paragraph best supports the statement that
Critical reading is a demanding process. To read critically, you must slow down your reading and, with pencil in hand, perform specific operations on the text. Mark up the text with your reactions, conclusions, and questions. When you read, become an active participant
This paragraph best supports the statement that.
Forest fires feed on decades-long accumulations of debris and leap from the tops of young trees into the branches of mature trees. Fires that jump from treetop to treetop can be devastating. In old-growth forests, however, the shade of mature trees keeps thickets of small trees from sprouting, and the lower branches of mature trees are too high to catch the flames.
This paragraph best supports the statement that
During the last six years, the number of practicing physicians has increased by about 20%. During the same time period, the number of healthcare managers has increased by more than 600%. These percentages mean that many doctors have lost the authority to make their own schedules, determine the fees that they charge, and decide on prescribed treatments.
This paragraph best supports the statement that doctors
In the 1966 Supreme Court decision Miranda v. Arizona, the court held that before the police can obtain statements from a person subjected to an interrogation, the person must be given a Miranda warning. This warning means that a person must be told that he or she has the right to remain silent during the police interrogation. Violation of this right means that any statement that the person makes is not admissible in a court hearing.
This paragraph best supports the statement that
By the time they reach adulthood, most people can perform many different activities involving motor skills. Motor skills involve such diverse tasks as riding a bicycle, threading a needle, and cooking a dinner. What all these activities have in common is their dependence on precision and timing of muscular movement.
This paragraph best supports the statement that.
The Fourth Amendment to the Constitution protects citizens against unreasonable searches and seizures. No search of a person's home or personal effects may be conducted without a written search warrant issued on probable cause. This means that a neutral judge must approve the factual basis justifying a search before it can be conducted. This paragraph best supports the statement that the police cannot search a person's home or private papers unless they have.
This paragraph best support the statement that
Most Reality TV centers on two common motivators: fame and money. The shows transform waitresses, hairdressers, investment bankers, counselors, and teachers, to name a few, from obscure figures to house-hold names. A lucky few successfully parlay their fifteen minutes of fame into celebrity. The luckiest stars of Reality TV also reap huge financial rewards for acts including eating large insects, marrying someone they barely know, and revealing their innermost thoughts to millions of people.
This paragraph best supports the statement that.
Mathematics allows us to expand our consciousness. Mathematics tells us about economic trends, patterns of disease, and the growth of populations. Math is good at exposing the truth, but it can also perpetuate misunderstandings and untruths. Figures have the power to mislead people.
This paragraph best supports the statement that | 872 | 4,696 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.921875 | 3 | CC-MAIN-2023-06 | latest | en | 0.939582 |
https://www.gradesaver.com/textbooks/math/calculus/calculus-early-transcendentals-8th-edition/chapter-3-section-3-2-the-product-and-quotient-rules-3-2-exercises-page-189/55 | 1,539,731,249,000,000,000 | text/html | crawl-data/CC-MAIN-2018-43/segments/1539583510893.26/warc/CC-MAIN-20181016221847-20181017003347-00187.warc.gz | 947,861,648 | 13,808 | ## Calculus: Early Transcendentals 8th Edition
$$R'(0)=1$$
$$R(x)=\frac{x-3x^3+5x^5}{1+3x^3+6x^6+9x^9}$$ $$R(x)=\frac{f(x)}{g(x)}$$ According to Quotient Rule, $$R'(x)=\frac{f'(x)g(x)-f(x)g'(x)}{[g(x)]^2}$$ Therefore, $$R'(0)=\frac{f'(0)g(0)-f(0)g'(0)}{[g(0)]^2}$$ *Find $f(0)$, $g(0)$, $f'(0)$ and $g'(0)$ $$f(x)=x-3x^3+5x^5$$ So, $$f'(x)=1-9x^2+25x^4$$ Therefore, $f(0)=0-3\times0^3+5\times0^5=0$ and $f'(0)=1-9\times0^2+25\times0^4=1$ $$g(x)=1+3x^3+6x^6+9x^9$$ So, $$g'(x)=9x^2+36x^5+81x^8$$ Therefore, $g(0)=1+3\times0^3+6\times0^6+9\times0^9=1$ and $g'(0)=9\times0^2+36\times0^5+81\times0^8=0$ That means $$R'(0)=\frac{1\times1-0\times0}{1^2}=1$$ | 387 | 652 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.21875 | 4 | CC-MAIN-2018-43 | longest | en | 0.463147 |
http://www-formal.stanford.edu/jmc/elaboration/node9.html | 1,544,918,057,000,000,000 | text/html | crawl-data/CC-MAIN-2018-51/segments/1544376827137.61/warc/CC-MAIN-20181215222234-20181216004234-00284.warc.gz | 311,260,345 | 3,077 | Next: Formalizing some elaborations Up: Situation Calculus Representations Previous: Not so simple situation
## Actions by Persons and Joint Actions of Groups
When there is more than one actor acting, we can consider three levels of complexity. The simplest level is when the actors act jointly to achive the goal. The second level is when one actor (or more than one) does something to motivate the others, e.g. one person pays another to do something. This generalizes to a hierarchy of influence. The hard level is when the actors have competing motivations and must negotiate or fight. This is the subject of game theory, and we won't pursue it in this article.
As MCP was originally formulated, the missionaries and cannibals are moved like pieces on a chessboard. Let's consider elaborations in which the actions of individual missionaries and cannibals are considered. One eventual goal might be to allow a formalization in which a cannibal has to be persuaded to row another cannibal across the river and bring the boat back. However, our discussion starts with simpler phenomena.
We now consider an action by a person as a particular kind of event. What we have written we now write . If there is only one person, nothing is gained by the expansion.
Consider a proposition , meaning that the person can achieve the goal starting from the situation . For the time being we shall not say what goals are, because our present considerations are independent of that decision. The simplest case is that there is a sequence of actions such that
satisfies .
Now let's consider achievement by a group. We will say provided there is a sequence of events , where each is in , and the s are not assumed to be distinct, and such that
satisfies .
We can now introduce a simple notion of a person leading a group, written or more generally . We want the axioms
Thus a leader of a group can achieve whatever the group can achieve. Note that need not be a member of for this definition to work.
We could give the same definition for , but maybe it would be better to make a definition that requires that maintain his leadership of in the succeeding situations.
is too strong a statement in general, because the members of a group only accept leadership in some activities.
Next: Formalizing some elaborations Up: Situation Calculus Representations Previous: Not so simple situation
John McCarthy
2003-09-29 | 491 | 2,411 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.484375 | 3 | CC-MAIN-2018-51 | latest | en | 0.964256 |
http://www.physicsforums.com/showthread.php?s=2a8cd6a59f31911b4a79adbdd87509b6&p=4279632 | 1,369,068,531,000,000,000 | text/html | crawl-data/CC-MAIN-2013-20/segments/1368699113041/warc/CC-MAIN-20130516101153-00034-ip-10-60-113-184.ec2.internal.warc.gz | 668,303,722 | 7,673 | ## 2 dimensional chiral boson theory
I am reading the paper "Covariant Action for a D=11 Five-Brane with the Chiral Field" and want to make an analog for the chiral field in 2 dimensions.
But I don't know at the starting point, for if I take the local coordinates of the worldvolume to be ##x^m (m=0,1)##, the dual field strength ##F_{mnl}## will be zero and the action ##S## becomes ##S=\int d^2x\sqrt{-g}##.
Could anyone give me some advices?
Best Regards.
PhysOrg.com physics news on PhysOrg.com >> Promising doped zirconia>> New X-ray method shows how frog embryos could help thwart disease>> Bringing life into focus
The chiral boson in 2D was introduced e.g. by Floreanini and Jackiw (see here: http://prl.aps.org/abstract/PRL/v59/i17/p1873_1 ). In particular eq. 20 is the Lagrangian of the 2D chiral boson. There is also a relativistic version I believe (or, at least, a more covoriant notation), which is I believe due to Siegel. I'm not sure, but I think he treats it in this paper: http://www.sciencedirect.com/science...5032138490453X but I can't access it, because of the paywall... Now, keep in mind that the chiral boson is plagued by a lot of subtleties. It's a constrained system, which requires constrained quantization to turn it into a quantum theory. The theory may or may not have gauge invariance, depending on the boundary conditions. Finally, the theory has an annoying infrared divergence, which needs to be regularized using either a finite system size or the introduction of a mass term.
Dear xepma: Sorry for the late reply. I just wander how the action in the paper changes when I go from a 5-brane to a string? Could you give me some idea? Sincerely, Ren-Bo | 450 | 1,694 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.578125 | 3 | CC-MAIN-2013-20 | latest | en | 0.900957 |
https://www.solutioninn.com/a-company-is-considering-whether-to-market-a-new-product | 1,701,576,661,000,000,000 | text/html | crawl-data/CC-MAIN-2023-50/segments/1700679100484.76/warc/CC-MAIN-20231203030948-20231203060948-00199.warc.gz | 1,117,486,014 | 24,203 | # A company is considering whether to market a new product. Assume, for simplicity, that if this product is marketed, there
## Question:
A company is considering whether to market a new product. Assume, for simplicity, that if this product is marketed, there are only two possible outcomes: success or failure. The company assesses that the probabilities of these two outcomes are p and 1 - p, respectively. If the product is marketed and it proves to be a failure, the company will have a net loss of \$450,000. If the product is marketed and it proves to be a success, the company will have a net gain of \$750,000. If the company decides not to market the product, there is no gain or loss. The company is also considering whether to survey prospective buyers of this new product. The results of the consumer survey can be classified as favorable, neutral, or unfavorable. In similar cases where proposed products were eventually market successes, the fractions of cases where the survey results were favorable, neutral, or unfavorable were 0.6, 0.3, and 0.1, respectively. In similar cases where proposed products were eventually market failures, the fractions of cases where the survey results were favorable, neutral, or unfavorable were 0.1, 0.2, and 0.7, respectively. The total cost of administering this survey is C dollars.
a. Let p = 0.4. For which values of C, if any, would this company choose to conduct the consumer survey?
b. Let p = 0.4. What is the largest amount that this company would be willing to pay for perfect information about the potential success or failure of the new product?
c. Let p = 0.5 and C = \$15,000. Find the strategy that maximizes the company’s expected earnings in this situation. Does the optimal strategy involve conducting the consumer survey? Explain why or why not.
## This problem has been solved!
Related Book For
## Data Analysis and Decision Making
ISBN: 978-0538476126
4th edition
Authors: Christian Albright, Wayne Winston, Christopher Zappe
View Solution | 448 | 2,019 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.84375 | 3 | CC-MAIN-2023-50 | latest | en | 0.94998 |
https://www.gauthmath.com/solution/i1116018935 | 1,656,696,231,000,000,000 | text/html | crawl-data/CC-MAIN-2022-27/segments/1656103943339.53/warc/CC-MAIN-20220701155803-20220701185803-00136.warc.gz | 822,484,496 | 50,267 | # Find the domain and x intercepts.Gx=dfrac x4+x2+1x2-25
Question
### Gauthmathier8935
YES! We solved the question!
Check the full answer on App Gauthmath
Find the domain and intercepts.
Good Question (56)
4.7
Clear explanation (92)
Easy to understand (87)
Excellent Handwriting (75)
Detailed steps (69)
Write neatly (57)
Help me a lot (16)
### Gauthmathier9302
domain: all real numbers except ,
No real zeros No intercept
Explanation
Domain: zeros: ,
domain: all real numbers except ,
intercepts:
No real zeros No intercept
Thanks (159) | 149 | 546 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.671875 | 3 | CC-MAIN-2022-27 | longest | en | 0.667743 |
https://www.netzsch-thermal-analysis.com/de/industrien-branchen/glossary/youngs-modulus-or-storage-modulus/ | 1,579,971,328,000,000,000 | text/html | crawl-data/CC-MAIN-2020-05/segments/1579251678287.60/warc/CC-MAIN-20200125161753-20200125190753-00466.warc.gz | 983,951,156 | 7,899 | # Young’s Modulus or Storage Modulus
Young’s modulus, or storage modulus, is a mechanical property that measures the stiffness of a solid material. It defines the relationship between stress and strain in a material in the linear elasticity region of a uniaxial deformation.
Calculation of Young’s Modulus:
where:
E is Young’s modulus
σ is the uniaxial stress
ε is the strain along the direction of the applied stress
Relationship between the Elastic Moduli
E = 2G(1+μ) = 3K(1+2μ)
where:
E is Young’s modulus
G is the shear modulus
K is the bulk modulus
μ is the Poisson number
The figure depicts a given uniaxial stress for tensile (extension, left) or pressure (compression, right). A material with low stiffness (red) provides a higher deformation than a material with high stiffness (blue). Young’s modulus is a measure of the stiffness.
DMA | 204 | 853 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.765625 | 3 | CC-MAIN-2020-05 | latest | en | 0.865517 |
https://www.geeksforgeeks.org/minimize-sum-of-absolute-differences-of-same-indexed-elements-of-two-given-arrays-by-at-most-one-replacement/ | 1,696,208,013,000,000,000 | text/html | crawl-data/CC-MAIN-2023-40/segments/1695233510942.97/warc/CC-MAIN-20231002001302-20231002031302-00830.warc.gz | 847,643,028 | 44,914 | Open In App
# Minimize sum of absolute differences of same-indexed elements of two given arrays by at most one replacement
Given two arrays A[] and B[] of size N each, the task is to find the minimum possible sum of absolute difference of same indexed elements of the two arrays, i.e. sum of |A[i] – B[i]| for all i such that 0 ? i < N by replacing at most one element in A[] with another element of A[].
Examples:
Input: A[] = {6, 4, 1, 9, 7, 5}, B[] = {3, 9, 7, 4, 2, 1}, N = 6
Output: 22
Explanation: Replace A[2] with A[4]. The array A[] modifies to [6, 4, 7, 9, 7, 5]. This yields an absolute sum difference of |6 – 3| + |4 – 9| + |7 – 7| + |9 – 4| + |7 – 2| + |5 – 1| = 22, which is maximum possible.
Input: A[] = {2, 5, 8}, B[] = {7, 6, 1}, N = 3
Output: 7
Approach: The idea to solve the problem is to calculate for each B[i] (0 ? i < N), the closest element in A[] to B[i] using Binary Search and pick out the best choice.
Follow the steps below to solve the problem.
1. Initialize two arrays diff[] and BestDiff[] of size N.
2. Initialize a variable sum to 0.
3. Traverse from 0 to N – 1 and for each i store diff[i]= abs(A[i] – B[i]) and add diff[i] to sum.
4. Sort the array A[] in ascending order.
5. Iterate over the indices 0 to N – 1 and for each i, using binary search, find the element in A[] that is closest to B[i], say X and store it in BestDiff[] as BestDiff[i] = abs(B[i] – X)
6. Initialize a variable BestPick.
7. Iterate over the indices 0 to N – 1 and update BestPick as BestPick = max(BestPick, diff[i]-BestDiff[i])
8. Now, Sum – BestPick gives the answer.
Below is an implementation of the above approach:
## C++
`// C++ program for the above approach``#include ``using` `namespace` `std;` `// Function to return minimum sum of absolute``// difference of same-indexed elements of two arrays``int` `minAbsoluteSumDiff(vector<``int``> A,`` ``vector<``int``> B, ``int` `N)``{`` ``// Stores initial sum`` ``int` `sum = 0;` ` ``// Stores the differences between`` ``// same-indexed elements of A[] and B[]`` ``int` `diff[N];` ` ``for` `(``int` `i = 0; i < N; i++) {` ` ``// Update absolute difference`` ``diff[i] = ``abs``(A[i] - B[i]);` ` ``// Update sum of differences`` ``sum += diff[i];`` ``}` ` ``// Sort array A[] in ascending order`` ``sort(A.begin(), A.end());` ` ``// Stores best possible`` ``// difference for each i`` ``int` `bestDiff[N];` ` ``for` `(``int` `i = 0; i < N; i++) {` ` ``// Find the index in A[]`` ``// which >= B[i].`` ``int` `j = lower_bound(A.begin(), A.end(), B[i])`` ``- A.begin();` ` ``// Store minimum of abs(A[j] - B[i])`` ``// and abs(A[j - 1] - B[i])`` ``if` `(j != 0 && j != N)`` ``bestDiff[i] = min(``abs``(A[j] - B[i]),`` ``abs``(A[j - 1] - B[i]));` ` ``// If A[j] can be replaced`` ``else` `if` `(j == 0)`` ``bestDiff[i] = ``abs``(A[j] - B[i]);` ` ``// If A[j - 1] can be replaced`` ``else` `if` `(j == N)`` ``bestDiff[i] = ``abs``(A[j - 1] - B[i]);`` ``}` ` ``// Find best possible replacement`` ``int` `bestPick = 0;`` ``for` `(``int` `i = 0; i < N; i++) {`` ``bestPick = max(bestPick,`` ``diff[i] - bestDiff[i]);`` ``}` ` ``// Return the result`` ``return` `sum - bestPick;``}` `// Driver code``int` `main()``{`` ``// Input`` ``vector<``int``> A = { 2, 5, 8 };`` ``vector<``int``> B = { 7, 6, 1 };` ` ``int` `N = 3;` ` ``cout << minAbsoluteSumDiff(A, B, N) << endl;` ` ``return` `0;``}`
## Java
`// Java program for the above approach` `import` `java.io.*;``import` `java.util.*;` `class` `GFG {` ` ``// Recursive implementation of`` ``// lower_bound`` ``static` `int` `lower_bound(``int` `arr[], ``int` `low, ``int` `high,`` ``int` `X)`` ``{` ` ``// Base Case`` ``if` `(low > high) {`` ``return` `low;`` ``}` ` ``// Find the middle index`` ``int` `mid = low + (high - low) / ``2``;` ` ``// If arr[mid] is greater than`` ``// or equal to X then search`` ``// in left subarray`` ``if` `(arr[mid] >= X) {`` ``return` `lower_bound(arr, low, mid - ``1``, X);`` ``}` ` ``// If arr[mid] is less than X`` ``// then search in right subarray`` ``return` `lower_bound(arr, mid + ``1``, high, X);`` ``}` ` ``// Function to return minimum sum of absolute`` ``// difference of same-indexed elements of two arrays`` ``static` `int` `minAbsoluteSumDiff(``int` `A[], ``int` `B[], ``int` `N)`` ``{`` ``// Stores initial sum`` ``int` `sum = ``0``;` ` ``// Stores the differences between`` ``// same-indexed elements of A[] and B[]`` ``int` `diff[] = ``new` `int``[N];` ` ``for` `(``int` `i = ``0``; i < N; i++) {` ` ``// Update absolute difference`` ``diff[i] = Math.abs(A[i] - B[i]);` ` ``// Update sum of differences`` ``sum += diff[i];`` ``}` ` ``// Sort array A[] in ascending order`` ``Arrays.sort(A);` ` ``// Stores best possible`` ``// difference for each i`` ``int` `bestDiff[] = ``new` `int``[N];` ` ``for` `(``int` `i = ``0``; i < N; i++) {` ` ``// Find the index in A[]`` ``// which >= B[i].`` ``int` `j = lower_bound(A, ``0``, N - ``1``, B[i]);` ` ``// Store minimum of abs(A[j] - B[i])`` ``// and abs(A[j - 1] - B[i])`` ``if` `(j != ``0` `&& j != N)`` ``bestDiff[i]`` ``= Math.min(Math.abs(A[j] - B[i]),`` ``Math.abs(A[j - ``1``] - B[i]));` ` ``// If A[j] can be replaced`` ``else` `if` `(j == ``0``)`` ``bestDiff[i] = Math.abs(A[j] - B[i]);` ` ``// If A[j - 1] can be replaced`` ``else` `if` `(j == N)`` ``bestDiff[i] = Math.abs(A[j - ``1``] - B[i]);`` ``}` ` ``// Find best possible replacement`` ``int` `bestPick = ``0``;`` ``for` `(``int` `i = ``0``; i < N; i++) {`` ``bestPick`` ``= Math.max(bestPick, diff[i] - bestDiff[i]);`` ``}` ` ``// Return the result`` ``return` `sum - bestPick;`` ``}` ` ``// Driver code`` ``public` `static` `void` `main(String[] args)`` ``{`` ``// Input`` ``int` `A[] = { ``2``, ``5``, ``8` `};`` ``int` `B[] = { ``7``, ``6``, ``1` `};` ` ``int` `N = ``3``;` ` ``System.out.println(minAbsoluteSumDiff(A, B, N));`` ``}``}` `// This code is contributed by Dharanendra L V.`
## Python3
`# Python3 program for the above approach``from` `bisect ``import` `bisect_left,bisect_right` `# Function to return minimum sum of absolute``# difference of same-indexed elements of two arrays``def` `minAbsoluteSumDiff(A, B, N):`` ` ` ``# Stores initial sum`` ``sum` `=` `0` ` ``# Stores the differences between`` ``# same-indexed elements of A[] and B[]`` ``diff ``=` `[``0``] ``*` `N` ` ``for` `i ``in` `range``(N):` ` ``# Update absolute difference`` ``diff[i] ``=` `abs``(A[i] ``-` `B[i])` ` ``# Update sum of differences`` ``sum` `+``=` `diff[i]`` ` ` ``# Sort array A[] in ascending order`` ``A.sort()` ` ``# Stores best possible`` ``# difference for each i`` ``bestDiff ``=` `[``0``] ``*` `N` ` ``for` `i ``in` `range``(N):` ` ``# Find the index in A[]`` ``# which >= B[i].`` ``j ``=` `bisect_left(A, B[i])`` ` ` ``# Store minimum of abs(A[j] - B[i])`` ``# and abs(A[j - 1] - B[i])`` ``if` `(j !``=` `0` `and` `j !``=` `N):`` ``bestDiff[i] ``=` `min``(``abs``(A[j] ``-` `B[i]),`` ``abs``(A[j ``-` `1``] ``-` `B[i]))` ` ``# If A[j] can be replaced`` ``elif` `(j ``=``=` `0``):`` ``bestDiff[i] ``=` `abs``(A[j] ``-` `B[i])` ` ``# If A[j - 1] can be replaced`` ``elif` `(j ``=``=` `N):`` ``bestDiff[i] ``=` `abs``(A[j ``-` `1``] ``-` `B[i])`` ` ` ``# Find best possible replacement`` ``bestPick ``=` `0`` ` ` ``for` `i ``in` `range``(N):`` ``bestPick ``=` `max``(bestPick,`` ``diff[i] ``-` `bestDiff[i])` ` ``# Return the result`` ``return` `sum` `-` `bestPick` `# Driver code``if` `__name__ ``=``=` `"__main__"``:`` ` ` ``# Input`` ``A ``=` `[ ``2``, ``5``, ``8` `]`` ``B ``=` `[ ``7``, ``6``, ``1` `]` ` ``N ``=` `3` ` ``print``(minAbsoluteSumDiff(A, B, N))`` ` `# This code is contributed by ukasp`
## C#
`// C# program for the above approach``using` `System;` `class` `GFG {` ` ``// Recursive implementation of`` ``// lower_bound``static` `int` `lower_bound(``int` `[]arr, ``int` `low, ``int` `high, ``int` `X)`` ``{` ` ``// Base Case`` ``if` `(low > high) {`` ``return` `low;`` ``}` ` ``// Find the middle index`` ``int` `mid = low + (high - low) / 2;` ` ``// If arr[mid] is greater than`` ``// or equal to X then search`` ``// in left subarray`` ``if` `(arr[mid] >= X) {`` ``return` `lower_bound(arr, low, mid - 1, X);`` ``}` ` ``// If arr[mid] is less than X`` ``// then search in right subarray`` ``return` `lower_bound(arr, mid + 1, high, X);`` ``}` ` ``// Function to return minimum sum of absolute`` ``// difference of same-indexed elements of two arrays`` ``static` `int` `minAbsoluteSumDiff(``int` `[]A, ``int` `[]B, ``int` `N)`` ``{`` ``// Stores initial sum`` ``int` `sum = 0;` ` ``// Stores the differences between`` ``// same-indexed elements of A[] and B[]`` ``int` `[]diff = ``new` `int``[N];` ` ``for` `(``int` `i = 0; i < N; i++) {` ` ``// Update absolute difference`` ``diff[i] = Math.Abs(A[i] - B[i]);` ` ``// Update sum of differences`` ``sum += diff[i];`` ``}` ` ``// Sort array A[] in ascending order`` ``Array.Sort(A);` ` ``// Stores best possible`` ``// difference for each i`` ``int` `[]bestDiff = ``new` `int``[N];` ` ``for` `(``int` `i = 0; i < N; i++) {` ` ``// Find the index in A[]`` ``// which >= B[i].`` ``int` `j = lower_bound(A, 0, N - 1, B[i]);` ` ``// Store minimum of abs(A[j] - B[i])`` ``// and abs(A[j - 1] - B[i])`` ``if` `(j != 0 && j != N)`` ``bestDiff[i]`` ``= Math.Min(Math.Abs(A[j] - B[i]),`` ``Math.Abs(A[j - 1] - B[i]));` ` ``// If A[j] can be replaced`` ``else` `if` `(j == 0)`` ``bestDiff[i] = Math.Abs(A[j] - B[i]);` ` ``// If A[j - 1] can be replaced`` ``else` `if` `(j == N)`` ``bestDiff[i] = Math.Abs(A[j - 1] - B[i]);`` ``}` ` ``// Find best possible replacement`` ``int` `bestPick = 0;`` ``for` `(``int` `i = 0; i < N; i++) {`` ``bestPick`` ``= Math.Max(bestPick, diff[i] - bestDiff[i]);`` ``}` ` ``// Return the result`` ``return` `sum - bestPick;`` ``}` ` ``// Driver code`` ``public` `static` `void` `Main()`` ``{`` ``// Input`` ``int` `[]A = { 2, 5, 8 };`` ``int` `[]B = { 7, 6, 1 };` ` ``int` `N = 3;` ` ``Console.Write(minAbsoluteSumDiff(A, B, N));`` ``}``}` `// This code is contributed by ipg2016107.`
## Javascript
``
Output:
`7`
Time Complexity: O(NLogN)
Auxiliary Space:O(N) | 4,225 | 11,863 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.71875 | 4 | CC-MAIN-2023-40 | latest | en | 0.805085 |
https://turbo-tax.org/formula-for-inventory-turnover-in-excel/ | 1,708,763,734,000,000,000 | text/html | crawl-data/CC-MAIN-2024-10/segments/1707947474526.76/warc/CC-MAIN-20240224080616-20240224110616-00861.warc.gz | 595,103,647 | 7,697 | # Formula for Inventory Turnover in Excel
Home » Tax Tips » Formula for Inventory Turnover in Excel
The ultimate objective is for the purchasing and sales departments of a company to work in harmony. This guarantees that demand is not only high but also satisfied. In the end, inventory turnover ensures that you are not overbuying inventory and spending excessive amounts of money to keep it in stock when no one wants to buy it. Looking at the descriptions of the highlighted general ledger codes, we can see that many of them are adjustments to the value of inventory for a variety of reasons. We can also see what we paid for inbound freight and what we paid for labour, i.e., the wages for personnel creating our finished goods inventory. In many cases, the more a company’s assets are tied up in inventory, the more they rely on faster turnover.
That means it can lead to a different result than equations that use the cost of goods sold. Over-ordering or producing larger batches of a product than you can sell is a common culprit of a low inventory turnover ratio. While you never want to order so little product that your shelves are bare, it’s typically in your best interest to order conservatively, especially for a new product that you’ve never offered before.
1. You’ll need the typical inventory for your company rather than an exact amount.
2. For instance, if your average inventory value was \$50,000 and your COGS for the previous year were \$200,000 in goods, your inventory turnover ratio would be 4.
3. For 2021, the company’s inventory turnover ratio comes out to 2.0x, which indicates that the company has sold off its entire average inventory approximately 2.0 times across the period.
4. A high inventory turnover generally means that goods are sold faster and a low turnover rate indicates weak sales and excess inventories, which may be challenging for a business.
5. If you’re a company that purchases raw materials and manufactures finished goods, you may wish to calculate inventory turns for your finished goods separately from the inventory turns of your raw materials.
It is calculated by adding the value of inventory at the end of a period to the value of inventory at the end of the prior period and dividing the sum by 2. Watch this 10-minute video explanation of inventory turnover instead. Our partners cannot pay us to guarantee favorable reviews of their products or services.
## Inventory Turnover Ratio: What It Is, How It Works, and Formula
Using historical data to compare current years to past years could also provide helpful context. There are many reasons why a company may have a lower ITR than another company. It doesn’t always mean that one company is worse than the other.
If you’re a company that purchases raw materials and manufactures finished goods, you may wish to calculate inventory turns for your finished goods separately from the inventory turns of your raw materials. This gives you an idea of how well you’re managing each of these two categories of inventory. Since supply chain professionals use this metric to measure how well they manage inventory, their interest lies in the speed at which product is shipped out to customers.
## How To Calculate Inventory Turnover (With Formula and Examples)
You could also use email marketing and social media marketing to highlight specific products to existing and prospective customers. The higher your inventory turnover ratio, the better — within reason. Small-business owners should consider their product type and which inventory turnover ratio range is considered normal for their industry. For companies with low turnover ratios, the duration between when the inventory is purchased, produced/manufactured into a finished good, and then sold is more prolonged (i.e. requires more time).
Put another way, it takes an average of about 122 days (365 / 3) to sell out its inventory. Another purpose of examining inventory turnover is to compare a business with other businesses in the same industry. Companies gauge their operational efficiency based upon whether their inventory turnover is at par with, or surpasses, the average benchmark set per industry standards.
## Limitations of the Inventory Turnover Ratio
That said, low turnover ratios suggest lackluster demand from customers and the build-up of excess inventory. The formula used to calculate a company’s inventory turnover ratio is as follows. Thus, the inventory turnover rate determines how long it takes for a company to sell its entire inventory, creating the need to place more orders. Simply put, the higher the inventory ratio, the more efficiently the company maintains its inventory. There is the cost of the products themselves, whether that is manufacturing costs or wholesale costs. There is the cost of warehousing the products as well as the labor you spend on having people manage the inventory and work on sales.
## Inventory Turnover Calculator Template
The more efficient the system is, the healthier the company is with its cash flow. You can draw some conclusions from our examples that will help your business plan. Knowing how often you need to replenish inventory, you can plan orders or manufacturing lead times accordingly. When inventory isn’t moving quickly, the business must analyze why. Possible reasons could be that you have a product that people don’t want. Or, you can simply buy too much stock that is well beyond the demand for the product.
By hanging onto that old inventory, you could be missing the opportunity to sell another product several times over. With that in mind, offering discounts or a buy-one-get-one deal to move old inventory can be a worthwhile strategy. Advertising and marketing efforts are another great way to boost your inventory turnover ratio. Consider promoting products that have been sitting around for a while to consumers outside your established customer base.
## What does inventory turnover ratio tell you?
Many or all of the products featured here are from our partners who compensate us. This influences which products we write about and where and how the product appears on a page. Get instant access to video lessons taught by experienced investment bankers. Learn financial statement modeling, DCF, M&A, LBO, Comps and Excel shortcuts. Kelly Main is a Marketing Editor and Writer specializing in digital marketing, online advertising and web design and development.
We then add up the inventory cost of all of our items to get the total cost of our inventory. Let’s use the cost on the screen as our end of year value and calculate our inventory turns for the year in question. In some cases, the inventory value is the average cost of the inventory at the start of the year (if we’re calculating our metric annually) and the inventory cost at the end of the year. | 1,319 | 6,836 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.71875 | 3 | CC-MAIN-2024-10 | latest | en | 0.953246 |
https://community.wolfram.com/groups/-/m/t/371615 | 1,723,279,331,000,000,000 | text/html | crawl-data/CC-MAIN-2024-33/segments/1722640790444.57/warc/CC-MAIN-20240810061945-20240810091945-00234.warc.gz | 141,561,532 | 20,592 | 0
|
3942 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
GROUPS:
# Gauss iteration method-nestlist-stopping criteria
Posted 10 years ago
Hi All, I wanna solve Ax=b system using gauss iteration method. Bu I want the iteration stop when it reached stopping criteria. Instead of giving number of iteration before iteration start, iteration should stop when Norm(b-alast iteration)/Norm(b-afirst iteration)<10^(-10) I guess we I can use NestWhileList instead of NestList but I could not figure it out. Any suggestion? I have attached my code. Thanks in advance.. Selahittin.. Attachments:
4 Replies
Sort By:
Posted 10 years ago
I used Length[] and I got 28 that is what I am looking for..Thanks again..
Posted 10 years ago
Awesome!! Thanks. One more quick question. How can I find number of iteration? I used NestWhileList and count number of element in the list?
Posted 10 years ago
An alternative is to bake the length into the function. X[{j_, k_}] := {j + 1, BGS.k + Inverse[DD - EE].b} NestWhile[X, {0, X0}, (Norm[b - A.#[[2]]]/Norm[b] > 10^(-10)) &] (* Out[137]= {27, {1.00000000003, 1.00000000025, 0.999999999371, 1.00000000038, 1.00000000019}} *)
Posted 10 years ago
Here is one way. NestWhile[X, X0, (Norm[b - A.#]/Norm[b] > 10^(-10)) &] (* Out[22]= {1.00000000003, 1.00000000025, 0.999999999371, \ 1.00000000038, 1.00000000019} *) Could instead use FiexdPoint. FixedPoint[X, X0] (* Out[23]= {1., 1., 1., 1., 1.} *) | 460 | 1,436 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.015625 | 3 | CC-MAIN-2024-33 | latest | en | 0.706791 |
https://hobbyprojects.com/dictionary_of_units/length.html | 1,656,937,879,000,000,000 | text/html | crawl-data/CC-MAIN-2022-27/segments/1656104375714.75/warc/CC-MAIN-20220704111005-20220704141005-00660.warc.gz | 351,306,591 | 4,841 | Home > Electronic Tutorials > Dictionary of Units/Measurements > Length Unit
Dictionary of Units / Measurements
# Length Unit
The S I unit of length is the metre. To change any of these other units of length into their equivalent values in metres use the operation and conversion factor given. Those marked with # are exact. Other values are given to an appropriate degree of accuracy. Where some uncertainty is indicated it means that a good idea of the size of the unit can be given but that a better value would depend upon knowing the period and/or culture in which the unit was being used.
Note than in matters concerned with land measurements, for the most accurate work, it is necessary to establish whether the US survey measures are being used or not.
angstroms divide by 10 000 000 000 # astronomical units x 149 598 550 000 barleycorns x 0.008 467 centimeters x 0.01 # chains (surveyors') x 20.1168 # cubits x (0.45 to 0.5) ells (UK) x 0.875 (but many variations) ems (pica) x 0.004 233 3 fathoms x 1.8288 # feet (UK and US) x 0.3048 # feet (US survey) x 0.304 800 609 6 furlongs x 201.168 # hands x 0.1016 # inches x 0.0254 # kilometers x 1000 # leagues x (4000 to 5000) light years x 9 460 500 000 000 000 links (surveyors') x 0.201 168 # metres [m] 1 microns (=micrometers) x 0.000 001 # miles (UK and US) x 1609.344 # miles (nautical) x 1852 # parsecs x 30 856 770 000 000 000 perch (=rods or poles) x 5.0292 # picas (computer) x 0.004 233 333 picas (printers') x 0.004 217 518 points (computer) x 0.000 352 777 8 points (printers') x 0.000 351 459 8 yards x 0.9144 # | 537 | 1,864 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.75 | 3 | CC-MAIN-2022-27 | latest | en | 0.634452 |
http://stevekifowit.com/archives/M109/ca_sec3_2a.html | 1,579,359,566,000,000,000 | text/html | crawl-data/CC-MAIN-2020-05/segments/1579250592636.25/warc/CC-MAIN-20200118135205-20200118163205-00055.warc.gz | 153,274,933 | 19,659 | # Section 3.2 - Polynomials: Graphs and Properties
Section Objectives
1. Find the zeros of a polynomial and determine their multiplicities.
2. Determine the end behavior of a polynomial function.
3. Use intercepts and end behavior to graph a polynomial function.
### Polynomials
An $n$-th-degree polynomial in the variable $x$ is a function of the form
$f(x)=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0$,
where the coefficients $a_n$, $a_{n-1}$, $\dots$, $a_0$ are real or complex numbers with $a_n \ne 0$.
The zeros of a function $f$ are those $x$-values for which $f(x)=0$. The real zeros of $f$ correspond to the $x$-intercepts of the graph of $f$: if the number $k$ is a zero of $f$, then $(k,0)$ is an $x$-intercept of the graph.
To find the zeros of a polynomial function, we must solve a polynomial equation of the form
$a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0=0.$
General polynomial equations are often solved by first making one side of the equation equal to zero. After doing so, the next steps may vary depending on the nature of the polynomial. For now, we will focus on solving by factoring.
### Factored polynomials and zeros
When a polynomial is completely factored, the number of times a specific linear factor occurs in the factorization is called the multiplicity of the corresponding zero.
#### Examples
• $g(x)=4(x-1)^3(x+5)(x+8)^2$ has zeros $x=1$, $x=-5$, and $x=-8$, with multiplicities 3, 1, and 2, respectively.
• Let $f(x)=x^7(x-1)^5(x+2)$. Find the zeros of $f$ and their multiplicities.
• Find the zeros (and their multiplicities) of $f(x)=x^2+8x+16$.
### End behavior, zeros, and polynomial graphs
The general shape of the graph of a polynomial can be easily determined from the polynomial's factored form.
• The graph crosses the $x$-axis at every zero of multiplicity 1.
• The graph flattens and crosses the $x$-axis at every zero of odd multiplicity.
• The graph flattens, touches, and bounces off the $x$-axis at every zero of even multiplicity.
• The end behavior (the behavior as $x \to \pm \infty$) of the graph of is identical to that of $y=a_nx^n$, where $n$ is the degree and $a_n$ is the leading coefficient:
• $n$ even and $a_n$ positive $\longrightarrow$ up left and up right
• $n$ even and $a_n$ negative $\longrightarrow$ down left and down right
• $n$ odd and $a_n$ positive $\longrightarrow$ down left and up right
• $n$ odd and $a_n$ negative $\longrightarrow$ up left and down right
#### Example
• Here is the graph of $f(x)=0.001(x-4)^3(x-1)(x+3)^2$.
• Discuss the zeros and the features of the graph of $g(x)=x^2(x-3)^5$.
• Imagine you were given the graph of a polynomial function, but you were not given the polynomial itself. Could you make good predictions about the zeros and their multiplicities? | 798 | 2,771 | {"found_math": true, "script_math_tex": 47, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.875 | 5 | CC-MAIN-2020-05 | latest | en | 0.8522 |
https://www.compadre.org/introphys/search/search.cfm?b=1&gs=228 | 1,718,460,645,000,000,000 | text/html | crawl-data/CC-MAIN-2024-26/segments/1718198861594.22/warc/CC-MAIN-20240615124455-20240615154455-00321.warc.gz | 651,371,740 | 14,650 | ## Search Results
You may use the options below to change your display:
Alter display preferences
results per page
Restricted to General Topic: Optics
By Subject:
By Resource Type:
By Course Level:
By Math Level:
By Context:
• (11+)
• (2+)
• (9+)
• (72+)
• (119+)
• (27+)
• (4+)
• (1+)
By Collection:
Results #1-#10 of 100+
sort by: relevance | subject | date | title | author
Match Score:
100
Byline:
R. Berg
The Physics is Phun Program Schedule is a repository of the word documents and PowerPoint presentations used as part of the the Physics is Phun Program.
Please be aware that our link checker has indicated a possible issue with the link to this material.
Match Score:
100
Byline:
D. McBride
This learning activity teaches the basics of human vision. It covers the topics of basic optics, the structure of the eye, and the effects of the accommodation lens within the eye.…
Match Score:
100
Byline:
T. Slater
In this laboratory activity, students learn about lenses and telescope construction. Students will describe the nature of convex lenses, measure the focal length of several lenses,…
Match Score:
100
Byline:
R. Widenhorn
This laboratory exercise uses standard physics laboratory equipment to create an analogy to image formation in Computed Tomography. Objects are placed in an enclosure that is largely…
Differential X-Ray Absorption JS Model [ Computer Program ]
Match Score:
100
Byline:
M. Gallis
The Differential X-Ray Absorption JavaScript Model provides a qualitative exploration of how X-rays interact with varying material properties and how this difference can produce…
Match Score:
100
Byline:
F. Hwang
This page contains a short explanation and Java simulation of the physics behind rainbows. It covers the reflection and refraction effects of light inside a water droplet as well as…
Blackbody Radiation: Frequency and Wavelength [ Computer Program ]
Match Score:
100
Byline:
J. Palop
The Blackbody Radiation: Frequency and Wavelength model simulates the blackbody radiation curves of Planck both as a function of frequency and as a function of wavelength to allow…
Single-Slit Diffraction [ Computer Program ]
Match Score:
100
Byline:
J. Palop
The Single-Slit Diffraction model simulates the diffraction pattern of light as it travels through a slit to a screen. The diffraction pattern is due to the difference in path length…
Match Score:
100
Byline:
R. Vieyra
This lesson blends physics, geometric optics, and biology as students explore light refraction through convex and concave "lenses" made of clear gelatin. The activity promotes…
Find the Focal Length JS Model [ Computer Program ]
Match Score:
100
Byline:
A. Duffy and M. Belloni
The Find the Focal Length JavaScript Model shows how a spherical mirror reflects the rays from a point source. The Model specifically asks the user to determine the focal length of…
Results #1-#10 of 100+ | 665 | 2,898 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.78125 | 3 | CC-MAIN-2024-26 | latest | en | 0.824362 |
https://www.algebraden.com/perimeter-of-equilateral-triangle.htm | 1,670,502,410,000,000,000 | text/html | crawl-data/CC-MAIN-2022-49/segments/1669446711336.41/warc/CC-MAIN-20221208114402-20221208144402-00343.warc.gz | 635,745,916 | 3,426 | Arithmetic
Arithmetic Progression
Associative Property
Averages
Brackets
Closure Property
Commutative Property
Conversion of Measurement Units
Cube Root
Decimal
Divisibility Principles
Equality
Exponents
Factors
Fractions
Fundamental Operations
H.C.F / G.C.D
Integers
L.C.M
Multiples
Multiplicative Identity
Multiplicative Inverse
Numbers
Percentages
Profit and Loss
Ratio and Proportion
Simple Interest
Square Root
Unitary Method
Algebra
Cartesian System
Order Relation
Polynomials
Probability
Standard Identities & their applications
Transpose
Geometry
Basic Geometrical Terms
Circle
Curves
Angles
Define Line, Line Segment and Rays
Non-Collinear Points
Parallelogram
Rectangle
Rhombus
Square
Three dimensional object
Trapezium
Triangle
Trigonometry
Trigonometry Ratios
Data-Handling
Arithmetic Mean
Frequency Distribution Table
Graphs
Median
Mode
Range
Videos
Solved Problems
Home >> Triangle >> Perimeter of Equilateral Triangle >>
## Perimeter of Equilateral Triangle
Properties Types / Classification Perimeter of Equilateral Triangle Median of Triangle Interior of a Triangle Exterior of a Triangle Altitude of a Triangle Interior Angles of Triangle Exterior Angles of Triangle Interior Opposite Angles of Triangle Adjacent Interior Angle of Triangle Congruent Triangles Area of Triangle Area of Triangle by Heron's Formula Construction of Triangle (compass)
Before you read this article you must know, What is Perimeter Perimeter of Equilateral Triangle is to sum of length of all its sides So, Perimeter of Equilateral Triangle = side + side + side We know that in Equilateral Triangle all sides are equal, so we get; Perimeter of Equilateral Triangle = 3 side P = 3s Example 1 - In the following equilateral triangle Perimeter of Equilateral Triangle = 3 s P = 3 * 3 P = 9cm Example 2 - In the following equilateral triangle Perimeter of Equilateral Triangle = 3 s P = 3 * 5 P = 15 cm
Copyright@2022 Algebraden.com (Math, Algebra & Geometry tutorials for school and home education) | 471 | 1,998 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.125 | 4 | CC-MAIN-2022-49 | latest | en | 0.765301 |
http://mymathforum.com/algebra/14766-factoring-polynomials.html | 1,544,856,892,000,000,000 | text/html | crawl-data/CC-MAIN-2018-51/segments/1544376826800.31/warc/CC-MAIN-20181215061532-20181215083532-00468.warc.gz | 206,967,924 | 8,840 | My Math Forum Factoring Polynomials:
Algebra Pre-Algebra and Basic Algebra Math Forum
September 26th, 2010, 11:51 AM #1 Member Joined: Sep 2008 Posts: 97 Thanks: 0 Factoring Polynomials: I am just starting to learn about factoring polynomials and plugged this problem into mathway.com m(m-n)-2n(n-m) I've figured out most of the steps but i'm having trouble with the final answer. "In this problem and 2-1=1, so insert 2 as the right hand term of one factor and -1 as the right-hand term of the other factor. (m+2n)(m-n)" This is as far as i've gotten: How do i get the final answer? Can someone explain it a little more?
September 26th, 2010, 12:04 PM #2 Senior Member Joined: Jul 2010 From: St. Augustine, FL., U.S.A.'s oldest city Posts: 12,208 Thanks: 516 Math Focus: Calculus/ODEs Re: Factoring Polynomials: If you've got: m(m - n) - 2n(n - m) and you want to factor it, use (m - n) = -(n - m) to rewrite it as: m(m - n) + 2n(m - n) then, factor out the (m - n) common to both terms as follows: (m - n)(m + 2n) and it is now factored.
September 26th, 2010, 02:55 PM #3 Member Joined: Sep 2008 Posts: 97 Thanks: 0 Re: Factoring Polynomials: This is interesting. ... I think i'll try this one out on some of my problems. Thank you!
Tags factoring, polynomials
Thread Tools Display Modes Linear Mode
Similar Threads Thread Thread Starter Forum Replies Last Post J.Xavier Algebra 1 May 5th, 2013 05:29 PM IDoNotLikeMath Algebra 4 July 10th, 2012 09:59 PM Pumpkin99 Algebra 1 October 6th, 2011 08:58 PM jokerthief Algebra 5 October 6th, 2007 03:23 PM BrandonFlorida Real Analysis 3 May 26th, 2007 12:14 PM
Contact - Home - Forums - Cryptocurrency Forum - Top | 520 | 1,680 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.59375 | 4 | CC-MAIN-2018-51 | longest | en | 0.909312 |
http://stackoverflow.com/questions/10301104/4-bit-binary-number-multiplier-by-3-mod-16 | 1,395,028,869,000,000,000 | text/html | crawl-data/CC-MAIN-2014-10/segments/1394678704624/warc/CC-MAIN-20140313024504-00035-ip-10-183-142-35.ec2.internal.warc.gz | 131,438,294 | 15,217 | 4 bit binary number multiplier by 3 (mod 16)
I have a question in a past paper which asks to design as a minimised sum of products, and using only NAND gates, a circuit which takes 4 bit binary input and multiplies that number by 3 (mod 16)
Here is the truth table I have derived
``````Inputs Outputs
w x y z | a b c d
0 0 0 0 | 0 0 0 0
0 0 0 1 | 0 0 1 1
0 0 1 0 | 0 1 1 0
0 0 1 1 | 1 1 0 0
0 1 0 0 | 1 0 0 0
0 1 0 1 | 1 1 1 0
0 1 1 0 | 0 1 0 0
0 1 1 1 | 1 0 1 0
1 0 0 0 | 0 0 0 0
1 0 0 1 | 0 1 1 0
1 0 1 0 | 1 1 0 0
1 0 1 1 | 0 0 1 0
1 1 0 0 | 1 0 0 0
1 1 0 1 | 1 1 1 0
1 1 1 0 | 0 1 0 0
1 1 1 1 | 1 0 1 0
``````
From here I have created 4 Karnaugh Maps:
``````wx|yz|00 01 11 10
_____|___________
00 |0 0 1 0
01 |1 1 1 0
11 |1 1 1 0
10 |0 0 0 1
(a)
wx|yz|00 01 11 10
_____|___________
00 |0 0 1 1
01 |0 1 0 1
11 |0 1 0 1
10 |0 1 0 1
(b)
wx|yz|00 01 11 10
_____|___________
00 |0 1 0 1
01 |0 1 1 0
11 |0 1 1 0
10 |0 1 1 0
(c)
wx|yz|00 01 11 10
_____|___________
00 |0 1 0 0
01 |0 0 0 0
11 |0 0 0 0
10 |0 0 0 0
(d)
``````
Here are my questions: Will there be any don't care conditions in these Karnaugh Maps. how do I tell if there are or not?
Also, this will give me four boolean expressions resulting in 4 independent circuits. Do I need to connect them together as one big circuit somehow?
Finally, is there a certain mechanical procedure I can apply to the final boolean expressions in order to convert then to NAND Gates?
-
Your truth table is wrong - it looks like you skipped a row - the first three rows are OK and then you have 3*3 = 12 and after that it's all messed up. – Paul R Apr 24 '12 at 16:09 | 822 | 1,701 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.953125 | 3 | CC-MAIN-2014-10 | latest | en | 0.876321 |
https://ebs.sakarya.edu.tr/Ders/Detay/533563 | 1,621,147,100,000,000,000 | text/html | crawl-data/CC-MAIN-2021-21/segments/1620243989690.55/warc/CC-MAIN-20210516044552-20210516074552-00629.warc.gz | 249,594,270 | 20,101 | Course Name Code Semester T+U Hours Credit ECTS
Hiperbolic Geometry MAT 580 0 3 + 0 3 6
Precondition Courses Students are assumed to be familiar with the course Differential Geometry I and Differential Geometry II. Recommended Optional Courses Course Language Turkish Course Level yuksek_lisans Course Type Optional Course Coordinator Prof.Dr. SOLEY ERSOY Course Lecturers Course Assistants Course Category Field Proper Education Course Objective The hyperbolic geometry course aims to give the fundamental knowledge for the studies of graduate students who study at geometry branch. Course Content Euclids parallel postulate, independence of the parallel postulate, Euclid n-space, spherical n- space, elliptic n-space, spherical arc length, spherical volume, spherical trigonometry, Lorentzian n- space, hyperbolic n- space, hyperbolic arc length, hyperbolic volume, hyperbolic trigonometry, reflections, stereographic projection, Mobius transformation, conformal disc model of hyperbolic space, Poincaré half-plain model, isometries of hyperbolic space
# Course Learning Outcomes Teaching Methods Assessment Methods
1 He/She knows the fundamental consepts of hyperbolic geometry Lecture, Question-Answer, Discussion, Group Study, Problem Solving, Testing, Homework,
2 He/She defines the fundamental calculations on Euclidean n-space, spherical n-space and eliptical n-space. Lecture, Question-Answer, Discussion, Group Study, Problem Solving, Testing, Homework,
3 He/She calculate hyperbolic arc length and hyperbolic volume Lecture, Question-Answer, Discussion, Group Study, Problem Solving, Testing, Homework,
4 He/She defines Mobious transformations, Poincare half plain model and isometries of the hyperbolic spaces. Lecture, Question-Answer, Discussion, Group Study, Problem Solving, Testing, Homework,
Week Course Topics Preliminary Preparation
1 Euclids parallel postulate, independence of the parallel postulate, Euclid n-space
2 Spherical n- space, elliptic n-space, spherical arc length, spherical volume
3 Spherical trigonometry
4 Lorentzian n- space, hyperbolic n- space
5 Hyperbolic arc length
6 Hyperbolic volume
7 Hyperbolic trigonometry
8 Reflections
9 Mid term exam
10 Stereographic projection
11 Mobius transformation
12 Conformal disc model of hyperbolic space
13 Poincaré half-plain model
14 Isometries of hyperbolic space
Resources
Course Notes 1.Ratcliffe, J. G., (1994), Foundations of Hyperbolic Manifolds, Springer-Verlag.
Course Resources 1. Fenchel, W., Walter de Gruyter, (1989), Elementary Geometry in Hyperbolic Space
Order Program Outcomes Level of Contribution
1 2 3 4 5
0 Develop strategic, political and practice plans and evaluate the results by taking into account the quality process in his/her area of expertise
2 Student follows the current journals in his/her field and puts forward problems. X
3 Student understands the relations between the disciplines pertaining to the undergraduate programs of Mathematics X
4 Student gets new knowledge by relating the already acquired experience and knowledge with the subject-matters out of his/her field. X
5 Student uses different proof methods to come to a solution by analyzing the problems encountered. X
6 Student determines the problems to be solved within his/her field and if necessary takes the lead. X
7 Student conveys, in team work, his/her knowledge in the studies done in different disciplines by applying the dynamics pertaining to his/her own field. X
8 Student critically evaluates the knowledge got at the bachelor´s degree level, makes up the missing knowledge and focuses on the current subject-matters X
9 Student knows a foreign language to communicate orally and in writing and uses the foreign language in a way that he/she can have a command of the Maths terminology and can do a source research. X
10 Student improves himself/herself at a level of expertness in Mathematics or in the fields of application by improving the knowledge got at the bachelor´s degree level. X
11 Student considers the scientific and cultural ethical values in the phases of gathering and conveying data or writing articles. X
Evaluation System
Semester Studies Contribution Rate
1. Ara Sınav 70
1. Ödev 30
Total 100
1. Yıl İçinin Başarıya 50
1. Final 50
Total 100 | 952 | 4,253 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.71875 | 3 | CC-MAIN-2021-21 | latest | en | 0.723939 |
http://physics.stackexchange.com/questions/17646/analytic-solutions-to-time-dependent-schrodinger-equation/19686 | 1,397,955,092,000,000,000 | text/html | crawl-data/CC-MAIN-2014-15/segments/1397609537804.4/warc/CC-MAIN-20140416005217-00317-ip-10-147-4-33.ec2.internal.warc.gz | 181,516,788 | 20,843 | # Analytic solutions to time-dependent Schrödinger equation
Are there analytic solutions to the time-Dependent Schrödinger equation, or is the equation too non-linear to solve non-numerically?
Specifically - are there solutions to time-Dependent Schrödinger wave function for an Infinite Potential Step, both time dependent and time inpendent cases?
I have looked, but everyone seems to focus on the time-Independent Schrödinger equation.
-
The time dependent equation for a time independent potential is solved by superpositions of the solutions to the time-independent problem, with the coefficients varying as exp(iEt). The equation is completely linear. – Ron Maimon Nov 30 '11 at 4:20
@RonMaimon: Not so simple. If this were the case, there'd be no reason to ever make a rotating wave approximation. Time dependence is particularly troublesome when there is no interaction picture which removes it. In an example case of a sinusoidal drive on a low dimensional system, there is no rotating frame without time dependence, and in general no analytic solution. Having said that, even in the time independent case you are fortunate if your ODE has an attainable analytic solution beyond a hand-wavey "it's just a matrix exponential". – qubyte Nov 30 '11 at 17:09
@Mark: Yes it is so simple, your examples are completely irrelevant. No need muddy this simple question--- it's just asking about the time-dependent equation for a time independent potential. A sinusoidal drive is not time independent. Rotating frames produce time independent forces in the rotating frame, a global centrifugal potential and a coriolis magnetic-type force, so they can be made time independent. Lots and lots of problems have analytic solutions if you start with an known ground state and vary coefficients. – Ron Maimon Nov 30 '11 at 18:08
@RonMaimon: Calm down there. I misread the start of your comment. In any case I'm not "muddying the question" since the comment was clearly directed at you. Anyway, in my experience it's only the special cases that can be solved. Throw a few small systems together and you've got a many body problem (unless you have a lot of symmetry). As we rarely deal with just a few two level systems, that pretty much describes everything unless you're willing to approximate. But I digress... – qubyte Nov 30 '11 at 18:22
@Everitt: I agree. I didn't mean to sound abrasive, just haven't had my coffee yet. – Ron Maimon Nov 30 '11 at 18:35
show 1 more comment
The complete solution for the time dependent equation with an infinite potential step is found by the method of images. Given any initial wavefunction
$$\psi_0(x)$$
for x<0, you write down the antisymmetric extension of the wavefunction
$$\psi_0(x) = \psi_0(x) - \psi_0(-x)$$
And you solve the free Schrodinger equation. So any solution of the free Schrodinger equation gives a solution for the infinite potential step. This is not completely trivial to make, because the solutions do not vanish in any region. But, for example, the spreading delta-function
$$\psi(x,t) = {1\over \sqrt{2\pi it}} e^{-(x-x_0)^2\over it }$$
Turns into the spreading, reflecting, delta function
$$\psi(x,t) = {1\over \sqrt{2\pi it}} e^{-(x-x_0)^2\over it } - {1\over \sqrt{2\pi it}} e^{-(x+x_0)^2\over it }$$
You can do the same thing with the spreading Gaussian wavepacket, just subtract the solution translated to +x from the solution translated to -x. In this case, normalizing the wavefunction is hard when the wavefunction start out close to the reflection wall.
### Time independent infinite potential wall
The solution to the time independent problem of the infinite potential wall are all wavefunctions of the form
$$\sin(kx)$$
for all k>0. Superposing these solutions gives all antisymmetric functions on the real line.
To find this solution, note that the time independent problem (eigenvalue problem) for the Schrodinger equation is solved by sinusoidal waves of the form $e^{ikx}$, and you need to superposes these so that they are zero at the origin, to obey the reflection condition. This requires that you add two k-waves up with opposite signs of k and opposite sign coefficients.
The opposite sign of k just means that the wave bounces off the wall (so that k changes sign), while the opposite sign of the coefficient means that the phase is opposite upon reflection, so that the wave at the wall cancels.
### General solution
The time dependent problem for a time independent potnetial is just the sum of the solutions to the time independent problem with coefficients that vary in time sinusoidally.
If the eigenfunctions $\psi_n$ are known, and their energies $E_n$ are known, and the potential doesn't change in time, then the,
$$\psi(t) = \sum_n C_n e^{-iE_n t} \psi_n(x)$$
is the general solution of the time dependent problem. This is so well known that generally people don't bother saying they solved the time-dependent problem once they have solved the eigenvalue problem.
The general solution of the time-dependent Schrodinger equation for time dependent potentials doesn't reduce to an eigenvalue problem, so it is a different sort of thing. this is generally what people understand when you say solving the time-dependent equation, and this reflects the other answers you are getting. I don't think this was the intent of your question, you just wanted to know how to solve the time dependent equation for a time independent potential, in particular, for an infinite reflecting potential wall. This is just the bouncing solution described above.
-
Full marks Ron, this was just what I was trying to understand. Ironic that its so trivial no one mentions it. Can you recommend a text or source for this? – metzgeer Dec 1 '11 at 1:09
I don't think there is any more to say about it that what I said above, also, look here: physics.stackexchange.com/questions/12611/… . The grandaddy of all exact solution for a time independent problem is the Gaussian wavepacket, which you can work out most easily from knowing the stochastic version. I worked it out here: en.wikipedia.org/wiki/User:Likebox/Schrodinger , it used to be on Wikipedia, before that project degenrated. I can't recommend any other literature on elementary stuff, unfortunately. – Ron Maimon Dec 1 '11 at 1:41
@metzgeer: It doesn't contain this problem specifically (I think, it may since have been updated), but I highly recommend Introduction to Quantum Mechanics by Griffiths. It contains some introductory examples and problems to work though which are very helpful for solidifying the methods used in quantum mechanics at this level. It is also in a conversational tone that will probably appeal to you if you enjoy using SE. :) – qubyte Dec 1 '11 at 4:15
@MarkS.Everitt: Oh thank Saint Albertus Magnus the patron saint of scientists, for physics books at a conversational tone - or I would never make it :) – metzgeer Dec 1 '11 at 10:22
@metzgeer: Eek, sorry I hope I didn't cause any offence. I recommend it because it's my favourite! – qubyte Dec 1 '11 at 10:32
The equation is analytically solveable if you allow the potential to vary in magnitude but keep the borders fixed. Then, you can assume the form $\sum_{n} A_{n}(t) \sin\left(\frac{\pi n x}{L}\right)$ for the wavefunction.
Substituting this form of the wavefunction into $\frac{\hbar}{i}\frac{d\psi}{dt}=-\frac{\hbar^{2}}{2m}\frac{d^{2}\psi}{dx^{2}}+V(t)\psi$ results in:
$$0=\sum_{n} \sin\left(\frac{\pi n x}{L}\right)\left[ \frac{\hbar \dot A_{n}}{i} - \frac{\hbar^{2}A_{n}\pi^{2}n^{2}}{2mL} +V A_{n} \right]$$
Since each sine term has independent nodes and antinodes, each of the enclosed factors must be independently zero. The solution integrates to:
$$A_{n}=a_{n}\exp\left(\frac{\pi^{2}\hbar n^{2} i t}{2mL^{2}}\right)\exp\left(\frac{i}{\hbar}\int V(t) dt\right)$$
Where the $a_{n}$ are constants. Note that this differs from the standard infinite square well solution only by the second factor involving the integral of the potential energy. Also, note that there is nothing that depends on $n$ in this term, so this solution can be pulled out of the sum entirely, and thus simply multiplies the old wavefunction by an overall phase, and generates a physically identical wavefunction to our old, constant-$V(t)$ solution.
I'm almost certain that exact anlaytic solutions exist for less trivial solutions, but varying the potential on the infinite square well doesn't do much, in the end.
-
This is for a infinite potential well isn't it, I'm trying to understand an infinite potential step, do I simply increase the width of the well to let L approach infinity? – metzgeer Nov 30 '11 at 4:08
@metzgeer: I don't understand what an infinite potential step is--do you mean a potential that is $V=V(t)$ for $x > 0$, and $\infty$ otherwise? – Jerry Schirmer Nov 30 '11 at 16:46
you're quite right jerry. I was thinking of a time varying $\psi(x,t)$ variable, not in terms of V(x,t) I should have said V(x) = $\infty$ for all time. Mea culpa. – metzgeer Dec 1 '11 at 1:00
@metzgeer: in that case, the time-independent schrodinger solutions, with each basis function multiplied by $\exp(iEt)$ gives you the correct time-dependent wavefunction. This will be true for all potentials that don't depend on the time. – Jerry Schirmer Dec 1 '11 at 12:18
The universe has a sense of humour, so I cannot resist supplementing a question
which has the word « analytic » in its title... in a minute, you will see why I would have preferred you to use the phrase « closed-form », with the following observation--answer.
For any time-independent potential $V(x)$, let $H = -{\partial^2\over\partial x^2} + V(x)$. (What I am about to say works for any time-independent $H$, and if a system is isolated, the Hamiltonian is always time-independent even though Schroedinger's equation is time-dependent.) Suppose the system starts in the initial state $\psi_o$, a wave function of $x$ of course. Then the following analytic function of time gives the solution to the time-dependent Schroedinger equation:
$$\psi(x,t) = e^{itH}\cdot\psi_o.$$
This is similar to the last formula given by Mr. Maimon which told you, as he explained, how to get the solution to the time-dependent Schroedinger equation once you have solved the time-independent equation for all its eigenvalues and eigenstates. The difference is that in that formula, $E$ was one of the many eigenvalues of the operator $H$, but here we can simply plug in $H$ as an operator into the holomorphic (analytic) function $e^z$ (one way is by using the power series of this analytic function).
Hence the universes' pun between analytic as a synonym for closed-form expression but also as a synonym for holomorphic which means it can be expressed as a convergent power series and extended as a function to the entire complex number plane, which is done in some approaches to Quantum Field Theory, e.g., by Streater and Wightman, and in some approaches to path integrals.
This approach is less practical for your specific situation than the answer by Mr. Maimon which is well-adapted to your specific problem...but it gives a closed-form formula, generalises well even to potentials $V$ with singularities, infinities, etc., and sometimes can help you think about the physics of the problem without getting lost in the gory details of calculating the answer.
I have often wondered whether it can be extended to time-varying potentials...I suspect it could be...
-
It can only be generalized as $\psi(x,t) = \exp (-i \int H(t') dt' ) \psi(x,0)$ if the Hamiltonian commutes with itself at different times, $[H(t),H(t')] = 0$. – perplexity Jan 19 '12 at 13:56 | 2,875 | 11,661 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.890625 | 3 | CC-MAIN-2014-15 | latest | en | 0.922352 |
https://www.kyoto2.org/what-does-median-pricing-mean/ | 1,716,002,222,000,000,000 | text/html | crawl-data/CC-MAIN-2024-22/segments/1715971057260.44/warc/CC-MAIN-20240518023912-20240518053912-00727.warc.gz | 765,263,654 | 14,510 | # Kyoto2.org
Tricks and tips for everyone
# What does median pricing mean?
## What does median pricing mean?
Table of Contents
The median price is the price in the very middle of a data set, with exactly half of the houses priced for less and half priced for more.
## What is the Australian median house price?
Quick Stats. The median national property price is \$549,918. Between February 2019 to February 2020, the house price index in Australia rose by 6.1%, with a monthly rise of 1.1%.
How much is a median house in Canada?
More On: canada In America, the median home price last month stood at \$375,000, an all-time high and a 15% rise from a year prior.
### Why is median used for house prices?
The “median price” is used as the most common indicator for the property market. This is because it more accurately reflects the sample size being used, the market trends, consumer sentiment and market conditions.
### How much does the average house cost in Australia 2021?
The sporting capital of Australia recorded an annual rise of 18.6 per cent, and a 5.8 per cent increase for the December quarter, boosting the average house price to \$1,101,612. However, an explosion of new listings in the last few months of 2021 may cause things to slow down in Melbourne’s market in 2022.
Is real estate cheap in Canada?
Canadian real estate is not cheap, and in cities like Toronto and Vancouver, it’s almost impossible to find an awesome property at an affordable price. However, if you’re willing to put in a little bit of hard work, there are houses for sale in Canada that actually cost less than \$25,000!
#### What is the difference between median price and average price?
The average is calculated by adding up all of the individual values and dividing this total by the number of observations. The median is calculated by taking the “middle” value, the value for which half of the observations are larger and half are smaller.
Why median is not a good average?
While the arithmetic mean considers all the values in a vector, the median value only considers a subset of values. This is because the median basically discards all vector elements except for the most central value(s). This feature of the median can make a big difference. | 490 | 2,258 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.53125 | 3 | CC-MAIN-2024-22 | latest | en | 0.946185 |
https://www.adda247.com/teaching-jobs-exam/maths-questions-for-all-teaching-exam_18/ | 1,675,742,607,000,000,000 | text/html | crawl-data/CC-MAIN-2023-06/segments/1674764500384.17/warc/CC-MAIN-20230207035749-20230207065749-00027.warc.gz | 603,822,252 | 118,325 | Latest Teaching jobs » Maths Questions for All Teaching Exam...
# Maths Questions for All Teaching Exam :18th February 2019(Solutions)
Dear Students!!! There is most general as well as a scoring section in all the competitive entrance examinations in the teaching field i.e “Mathematics”.Because in this section only one thing is work i.e your accuracy and that could be nourished with the daily practice. So, for this, we are providing you the daily quiz for all teaching exams i.e CTET Exam 2019, DSSSB ,KVS,STET Exam.
GET 5% DISCOUNT on CTET Prime :
Use This Code TEACH5
Q1. What is the number of students in the year 2003?
(a) 70
(b) 60
(c) 50
(d) 40
Q2. Is the number of students in the year 2002 twice that in the year 2000?
(a) Yes
(b) No
(c) Can’t be detain
Q3. For how many hours did the maximum number of students watch TV?
(a) 3-4
(b) 5-6
(c) 4-5
(d) 6-7
Q4. How many students watched TV for less than 4 h?
(a) 30
(b) 28
(c) 22
(d) 34
Q5. How many students spent more than 5 h in watching TV?
(a) 14
(b) 12
(c) 10
(d) 16
Q6. On which item, the expenditure was maximum?
(a) Clothes
(b) Food
(c) House rent
(d) Others
Q7. Expenditure on which item is equal to the total savings of the family?
(a) House rent
(b) Education for children
(c) Food
(d) Others
Q8. If the monthly savings of the family is Rs. 3000, what is the monthly expenditure on clothes?
(a) Rs. 1500
(b) Rs. 3000
(c) Rs. 2000
(d) Rs. 1800
Q9. Ashish studies for 4 h, 5 h and 3 h, respectively on three consecutive days. How many hours does he study daily on an average?
(a) 1 h/day
(b) 2 h/day
(c) 3 h/day
(d) 4 h/day
Q10. A batsman scored the following number of runs in six innings 36, 35, 50, 46, 60, 55. Calculate the mean runs scored by him in an innings.
(a) 46
(b) 47
(c) 50
(d) 60 | 581 | 1,790 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3 | 3 | CC-MAIN-2023-06 | latest | en | 0.872936 |
https://www.newscientist.com/letter/mg19726421-200-arbitrary-puzzle/ | 1,550,552,449,000,000,000 | text/html | crawl-data/CC-MAIN-2019-09/segments/1550247489343.24/warc/CC-MAIN-20190219041222-20190219063222-00020.warc.gz | 908,090,583 | 18,198 | Published 6 February 2008
Arbitrary puzzle
From Andy Biddulph
Your article on brain training included the puzzle below (12 January, p 26). You give the answer as 53, apparently by numbering the rows and columns starting at the bottom right corner, and appending the row number to the column number.
Another solution would be: the first digit in one column plus the first digit in the next-but-one column always add up to 10.
This would mean the first digit in each column is, from left to right: 9, 6, 1, 4, 9, 6, 1.
To find the second digit look at the row instead – the second digit …
Burton on Trent, Staffordshire, UK | 158 | 628 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.078125 | 3 | CC-MAIN-2019-09 | latest | en | 0.880204 |
http://www.codingforums.com/archive/index.php/t-232878.html | 1,386,849,033,000,000,000 | text/html | crawl-data/CC-MAIN-2013-48/segments/1386164581855/warc/CC-MAIN-20131204134301-00044-ip-10-33-133-15.ec2.internal.warc.gz | 284,057,338 | 6,215 | ...
Javascript specific calculator
Penny85
07-24-2011, 07:27 PM
Hello everyone, wondering if I could get some help. I have not done anything with html and javascript until this afternoon and funnily enough I'm struggling a tad :rolleyes: :o
I am creating a free website about the dangers of chocolate for dogs. Basically I need a calculator to calculate the toxic amount for the user input of their dogs weight in kgs. I figured doing one for each type of chocolate would be easier than doing something where a box was ticked for each type of chocolate so have been trying to do one for milk chocolate first.
This is my feeble attempt, it looks good but doesnt work, my javascript is clearly majorly wrong somewhere! :o
<html>
<script language="JavaScript">
function calc(form)
{
var f = parseFloat(form.kg.value);
var T = 0;
T = (f/0.45)*28.35;
}
// done hiding from old browsers -->
</script>
<body>
<FORM>
<h2>Toxic dose of milk chocolate</h2>
Enter dogs weight in kg:
<INPUT NAME="kg" VALUE="0" MAXLENGTH="100" SIZE=25>
<p>
Click to calculate toxic dose in grammes:
<INPUT NAME="calc" VALUE="Calculate" TYPE=BUTTON
onClick=kg(this.form)>
<p>
Toxic amount of milk chocolate is:
</FORM>
</body>
</html>
Can anybody help?
Philip M
07-24-2011, 07:45 PM
Here you are:-
<html>
<script type = "text/javascript">
function calc(form){
var f = parseFloat(form.kg.value);
if (isNaN(f) || (f < 0)) {
alert ("Invalid entry! Weight value must be a positive number!");
form.kg.value = "";
return false;
}
var T = 0;
T = (f/0.45)*28.35;
T = T.toFixed(2); // 2 decimal places
form.answer.value = T + " grams";
}
</script>
<body>
<form>
<h2>Toxic dose of milk chocolate</h2>
Enter dog's weight in kg:
<input type = "text" name = "kg" value="" size = "6">
<p>
Click to calculate toxic dose in grammes:
<input type = "button" value="Calculate" onClick="calc(this.form)">
<p>
Toxic amount of milk chocolate is:
</form>
</body>
</html>
If there are several different types of chocolate involved, suggest you use a select list for the user to choose.
Quizmaster: In vocabulary, what 'O' is a word that specifically refers to a person between 80 and 89 years of age?
Contestant: Old.
Penny85
07-24-2011, 07:49 PM
Thank you thank you thank you :D Very much appreaciated! :)
Philip M
07-24-2011, 07:57 PM
It occurs to me that you ought to make it clear to the user that the calculated toxic amount is what it says - the toxic amount. Amounts less than this are still very undesirable. In other words, if the toxic amount is 200 grms then it is not OK to give the dog 199 grms! Severe symptoms of theobromine poisoning may be evident at much lower doses. Simple rule - do not give any chocolate to your dog. Once dogs have tasted chocolate, they want more.
Penny85
07-24-2011, 08:15 PM
very true, I will make that clear.
I have now stumbled upon another problem, sorry! I have altered the formula for each type of chocolate and put 3 calculators on the page, all three are returning the same value!? :confused: One value is correct the others aren't and I'm confused beyond belief! the page and calculators are here http://dogsandchocolate.weebly.com/calculators.html the bottom calculator is returning the correct result, the other two have correct values but are returning the same answer as the bottom one?!
Philip M
07-24-2011, 08:38 PM
You may not have two or more scripts with duplicate function and/or variable names on the same page. The last one will overwrite the previous ones. So all your onclick event handlers call the same script. If you owned three dogs you would not give them all the same name and expect the right one to come when you called!
You must rename all the functions and variables to (say) calc1(), calc2(), calc3(), f1, f2, f3 and so on. Likewise the names of the HTML elements.
But as I say, it would be better if the user selected the type of chocolate from a drop-down select list, and you passed the value selected to a single calculation script.
Penny85
07-24-2011, 08:45 PM
I was intending to do that in the first place (the drop down list) but thought it would be too complicated. Ok, thank you again, I shall try again later, I understand what you are saying...I think :D What a task to decide upon for a sunday :rolleyes: nothing like a challenge! :)
Actually this is clearly more complex as I'm not getting it right still! How do I do a list with dropdowns or is that going to take a year to explain?
Philip M
07-24-2011, 09:03 PM
This should give you something to work with. Note that two values are passed, the name of the type of chocolate and the relevant value used in your calculations. These are separated by a ~ (tilde) and then split out into an array. So then both parts are available to you. Obviously you can add further options.
<form>
<select name = "chocType" onchange = "getChocType()">
<option value = "">Select a type of chocolate....</option>
<option value = "milk~0.45">Milk Chocolate</option>
<option value = "bittersweet~1.45">Bittersweet Chocolate</option>
<option value = "dark~4.05">Dark Chocolate</option>
</select>
</form>
<script type = "text/javascript">
function getChocType() {
var tp = document.forms[0].chocType.value; // the value of the selected option
if (tp != "") {
var type = tp.split("~"); // split the two parts into an array
alert ("You selected " + type[0] + " chocolate which has a calculation value of " + type[1]);
}
}
</script>
Penny85
07-24-2011, 10:30 PM
:o I'm sure that would be so amazingly helpful to someone with more brains than me that hadnt been using html and javascript for about 6 hours :o I hate to be a pain I'm sorry but I'm struggling still, where do I need to put in the formula for the calculations? thats great I have the drop down box in it now thank you but I'm not sure of how to make it calculate the relevent options.
Philip M
07-25-2011, 09:43 AM
Here you are (suggest you check that the calculations for each type of chocolate are correct.) You can add further options as required.
<html>
<script type = "text/javascript">
function calc(form){
var f = parseFloat(form.kg.value);
if (isNaN(f) || (f < 0) || f > 40) {
alert ("Invalid entry! Weight value must be a positive number maximum 40 kgs!");
form.kg.value = "";
return false;
}
var tp = form.chocType.value; // the value of the selected option
if (tp != "") { // if a selection has been made
var ctype = tp.split("~"); // split the two parts into an array
//alert ("You selected " + ctype[0] + " chocolate which has a calculation value of " + ctype[1]); // for testing
var T = 0;
var Tx = ctype[1];
T = f/Tx*28.35;
T = Math.round(T); // whole number as extreme accuracy not required
form.answer.value = T + " grams of " + ctype[0] + " chocolate";
}
else {
return false;
}
}
</script>
<body>
<form>
<h2>Toxic dose of chocolate for a dog</h2>
<h3 style="color:#ff0000;">But never give your dog any chocolate at all - it is poisonous</h3>
Enter dog's weight in kg:
<input type = "text" name = "kg" value="" size = "6">
<p>
<br>
<select name = "chocType" >
<option value = "">Select a type of chocolate....</option>
<option value = "milk~0.45">Milk Chocolate</option>
<option value = "bittersweet~1.45">Bittersweet Chocolate</option>
<option value = "dark~4.05">Dark Chocolate</option>
</select>
<br><br><br>
Click to calculate toxic dose in grams:
<input type = "button" value="Calculate" onclick="calc(this.form)">
<br><br>
Toxic amount of chocolate is:
</form>
</body>
</html>
Penny85
07-25-2011, 10:23 AM
:D :D :D Thank you so so much, I spent all evening trying to do that! You are a genious, I promise never to grace your lovely forum with such imbecile like questions again! :)
Philip M
07-25-2011, 11:06 AM
:D :D :D Thank you so so much, I spent all evening trying to do that! You are a genious, I promise never to grace your lovely forum with such imbecile like questions again! :)
It is often said that there are no silly questions - only stupid answers, although after many years involved with this forum I would not go quite as far as that. :) But sensible questions are always welcomed - that is what the forum is for. | 2,128 | 8,097 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.828125 | 3 | CC-MAIN-2013-48 | longest | en | 0.783688 |
https://last2win.com/2020/01/12/LeetCode/ | 1,618,526,969,000,000,000 | text/html | crawl-data/CC-MAIN-2021-17/segments/1618038088264.43/warc/CC-MAIN-20210415222106-20210416012106-00051.warc.gz | 427,882,983 | 18,330 | # LeetCode 1115. Print FooBar Alternately--多线程并发问题--Java解法--CyclicBarrier, synchronized, Semaphore 信号量
2020/01/12
Suppose you are given the following code:
``````class FooBar {
public void foo() {
for (int i = 0; i < n; i++) {
print("foo");
}
}
public void bar() {
for (int i = 0; i < n; i++) {
print("bar");
}
}
}
``````
The same instance of FooBar will be passed to two different threads. Thread A will call foo() while thread B will call bar(). Modify the given program to output “foobar” n times.
Example 1:
``````Input: n = 1
Output: "foobar"
Explanation: There are two threads being fired asynchronously. One of them calls foo(), while the other calls bar(). "foobar" is being output 1 time.
``````
Example 2:
``````Input: n = 2
Output: "foobarfoobar"
Explanation: "foobar" is being output 2 times.
``````
Java解法如下:
``````class FooBar {
volatile private int n;
private int flag = 0;
public FooBar(int n) {
this.n = n;
}
public void foo(Runnable printFoo) throws InterruptedException {
for (int i = 0; i < n; i++) {
synchronized (this) {
while (flag == 1) {
this.wait();
}
// printFoo.run() outputs "foo". Do not change or remove this line.
printFoo.run();
flag = 1;
this.notifyAll();
}
}
}
public void bar(Runnable printBar) throws InterruptedException {
for (int i = 0; i < n; i++) {
synchronized (this) {
while (flag == 0) {
this.wait();
}
// printBar.run() outputs "bar". Do not change or remove this line.
printBar.run();
flag = 0;
this.notifyAll();
}
}
}
}
``````
``````
class FooBar {
private int n;
private final CyclicBarrier barrier = new CyclicBarrier(2);
public FooBar(int n) {
this.n = n;
}
public void foo(Runnable printFoo) throws InterruptedException {
for (int i = 0; i < n; i++) {
// printFoo.run() outputs "foo". Do not change or remove this line.
printFoo.run();
try {
barrier.await();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
}
}
public void bar(Runnable printBar) throws InterruptedException {
for (int i = 0; i < n; i++) {
try {
barrier.await();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
// printBar.run() outputs "bar". Do not change or remove this line.
printBar.run();
}
}
}
``````
``````class FooBar {
private int n;
private final Semaphore foo = new Semaphore(0);
private final Semaphore bar = new Semaphore(1);
public FooBar(int n) {
this.n = n;
}
public void foo(Runnable printFoo) throws InterruptedException {
for (int i = 0; i < n; i++) {
bar.acquire();
// printFoo.run() outputs "foo". Do not change or remove this line.
printFoo.run();
foo.release();
}
}
public void bar(Runnable printBar) throws InterruptedException {
for (int i = 0; i < n; i++) {
foo.acquire();
// printBar.run() outputs "bar". Do not change or remove this line.
printBar.run();
bar.release();
}
}
}
`````` | 779 | 2,777 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.5625 | 3 | CC-MAIN-2021-17 | longest | en | 0.553859 |
http://www.slideshare.net/ChristopherConlan/answers-9848159 | 1,430,922,906,000,000,000 | text/html | crawl-data/CC-MAIN-2015-18/segments/1430458843691.6/warc/CC-MAIN-20150501054043-00059-ip-10-235-10-82.ec2.internal.warc.gz | 682,907,318 | 31,706 | Upcoming SlideShare
×
Thanks for flagging this SlideShare!
Oops! An error has occurred.
×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply
154
Published on
Answers to the puzzles!
Answers to the puzzles!
Published in: Entertainment & Humor
0 Likes
Statistics
Notes
• Full Name
Comment goes here.
Are you sure you want to Yes No
Your message goes here
• Be the first to comment
• Be the first to like this
Views
Total Views
154
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
2
0
Likes
0
Embeds 0
No embeds
No notes for slide
### Transcript
• 1. Puzzle 1
• Shrink the 3 to make it a cubed symbol, which makes:
• 9 - 2 = 1
3
• 2. Puzzle 2
• Everyone survives! Carrying the last two people takes half the time (2:30), which leaves 30 seconds to spare after carrying the obese individual.
• 3. Puzzle 3
• € 2 + €6 + €12 = 31.5 ST
• 4. Puzzle 4
• Right, down, left, up, up
• 5. Puzzle 5
• Spacebar – space – astronauts....
• Nought!
• 6. Puzzle 6
• Top right building
• 7. Puzzle 7
• Bosco – The B on the collar, the eyes are 'O's, the left ear is an S, the snout is a C
• 8. Puzzle 8
• Engineer
• 9. Puzzle 9
• Four! The two people behind it can see themselves and the other two, while the other two can see themselves, as well as their reflections
• 10. Puzzle 10 There are four seals! 8 animals with feathers (penguins + ostrichs) = 16 legs + 2 elephants = 24 legs + 2 giraffes = 32 legs 48 – 32 = 16, therefore 4 lions | 483 | 1,554 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.671875 | 3 | CC-MAIN-2015-18 | latest | en | 0.824305 |
https://www.physicsforums.com/threads/what-is-the-total-work-done-against-the-spring-force.202989/ | 1,513,361,481,000,000,000 | text/html | crawl-data/CC-MAIN-2017-51/segments/1512948577018.52/warc/CC-MAIN-20171215172833-20171215194833-00652.warc.gz | 805,537,747 | 14,154 | # What is the total work done against the spring force?
1. Dec 6, 2007
### Lyphta
1. The problem statement, all variables and given/known data
When a 75 gram mass is suspended from a vertical spring, the spring is stretched from a length of 4.0 cm to a length of 7.0 cm. If the mass is then pulled downward an additional 10.0 cm, what is the total work done against the spring force?
2. Relevant equations
U=mgh (Don't need the work equation because work = energy)
U= 1/2 k x^2 (equation for the elastic spring with potential energy.)
3. The attempt at a solution
mass = .075 kg
height = .21 m (.04+.07+.1 = .21m)
gravity = 9.81m/s^2
U=mgh
U= (.075)(9.81)(.21)
U= .15 J
I know the answer is wrong because the book says the answer is .21 J
Last edited: Dec 6, 2007
2. Dec 6, 2007
### rl.bhat
When there is no mass the length of the spring is 4 cm. When a 75 gram mass is suspended from a vertical spring, the spring is stretched from a length of 4.0 cm to a length of 7.0 cm. From this calculate the force constant k, and then calculate the work done. mgh is the work done when the body is falling freely. | 330 | 1,114 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.90625 | 4 | CC-MAIN-2017-51 | longest | en | 0.916655 |
http://www.ehow.co.uk/how_6391160_calculate-accuracy-measurements.html | 1,527,364,485,000,000,000 | text/html | crawl-data/CC-MAIN-2018-22/segments/1526794867859.88/warc/CC-MAIN-20180526190648-20180526210648-00287.warc.gz | 379,807,877 | 10,545 | DISCOVER
# How to Calculate the Accuracy of Measurements
Updated July 19, 2017
Calculating accuracy reveals how close a set of measurements are to an accepted reference value. This differs from precision, which describes how close the measurements are to each other. It is possible to have very precise measurements that are inaccurate. For example, if repeated measurements of a temperature are taken and each measurement is nearly identical, the results are considered precise. However, if these measurements are several degrees different from what the value should be, the results have low accuracy. Using a simple formula, the accuracy of measurements may be calculated.
Make a measurement using the appropriate instrument. For example, measuring the density of fresh water requires the volume and mass of a water sample to be taken and then the mass divided by the volume (density = mass/volume). If the mass of a 10.0ml sample of freshwater at 4 degrees Celsius (density varies slightly with temperature) measures 10.1 grams, then the density is 0.99 grams per cubic centimetre.
Reference the accepted value for the object being measured. Continuing the example, the reference density of fresh water at 4 degrees Celsius is 1.00g/cm3.
Subtract the measured value from the accepted value and then divide the difference by the accepted value. Multiply the quotient by 100 to produce the per cent error. The final formula appears as (measured value -- accepted value) รท accepted value x 100 = % error. Finishing the example, we find the per cent error of the measurement is one per cent ((0.99 -- 1.00)/1.00 x 100 = 1 %).
#### Things You'll Need
• Pencil
• Paper
• Measurement Data
• Measurement Reference Value | 367 | 1,723 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.671875 | 4 | CC-MAIN-2018-22 | latest | en | 0.89274 |
https://www.scribd.com/document/48632858/lisp | 1,511,028,659,000,000,000 | text/html | crawl-data/CC-MAIN-2017-47/segments/1510934805008.39/warc/CC-MAIN-20171118171235-20171118191235-00727.warc.gz | 864,130,154 | 77,397 | # LISP Primer
Contents Next: Preface
LISP Primer
Colin Allen - Maneesh Dhagat copyright 1996-2005
q q
q
Preface and Terms of Use LISt Processing r Background and Getting Started r Basic Data Types s Atoms s Lists r Some Primitive Functions s Constructors: Cons, List, and Append s Quote s Selectors: First and Rest r Changing Variable Values r More Functions and Predicates r Setf r Exercises Defining LISP functions r Defining Functions: Defun r Local and Global Variables r Using an Editor r Using Your Own Definitions in New Functions r Functions with Extended Bodies r Conditional Control s If s Cond r More Predicates and Functions s Equality Predicates
http://mypage.iu.edu/~colallen/lp/ (1 of 4)10/19/2005 1:45:24 AM
LISP Primer
Next: Preface
LISP Primer
Colin Allen - Maneesh Dhagat copyright 1996-2005
q q
q
Preface and Terms of Use LISt Processing r Background and Getting Started r Basic Data Types s Atoms s Lists r Some Primitive Functions s Constructors: Cons, List, and Append s Quote s Selectors: First and Rest r Changing Variable Values r More Functions and Predicates r Setf r Exercises Defining LISP functions r Defining Functions: Defun r Local and Global Variables r Using an Editor r Using Your Own Definitions in New Functions r Functions with Extended Bodies r Conditional Control s If
http://mypage.iu.edu/~colallen/lp/lp.html (1 of 4)10/19/2005 2:02:25 AM
LISP Primer
q
q
q
q
Cond r More Predicates and Functions s Equality Predicates s Checking for NIL s Logical Operators: And and Or r Exercises Recursion and Iteration r Recursive Definitions s A Simple Example s Using Trace To Watch Recursion s Another Example r Iteration Using Dotimes r Local Variables Using Let r Iteration Using Dolist r When To Use Recursion/When To Use Iteration r Tail Recursion r Timing Function Calls r Exercises Programming Techniques r A Word about LISP r Recursion on Simple Lists r Recursion on Nested Lists and Expressions r Recursion on Numbers r Ensuring Proper Termination r Abstraction r Summary of Rules r Exercises Simple Data Structures in LISP r Association Lists r Property Lists r Arrays, Vectors, and Strings s Arrays and Vectors s Strings r Defstruct r Exercises. Input and Output r Basic Printing r Nicer Output Using Format
s
http://mypage.iu.edu/~colallen/lp/lp.html (2 of 4)10/19/2005 2:02:25 AM
LISP Primer
q
q
Reading r Input and Output to Files r Converting Strings to Lists Functions, Lambda Expressions, and Macros r Eval r Lambda Expressions r Funcall r Apply r Mapcar r Backquote and Commas r Defmacro Appendix: Selected LISP primitives r * (FUNCTION) r + (FUNCTION) r - (FUNCTION) r 1+, 1- (FUNCTIONS) r = (PREDICATE) r <, >, <=, >= (PREDICATES) r and (MACRO) r append (FUNCTION) r apply (FUNCTION) r atom (PREDICATE) r butlast (FUNCTION) r car (FUNCTION) r caar, cadr, cdar, cddr, etc. (FUNCTIONS) r cdr (FUNCTION) r cond (MACRO) r cons (FUNCTION) r defun (MACRO) r do (SPECIAL FORM) r documentation (FUNCTION) r eql (PREDICATE) r eval (FUNCTION) r evenp, oddp (PREDICATES) r first (FUNCTION) r if (SPECIAL FORM) r length (FUNCTION) r let (SPECIAL FORM)
r
http://mypage.iu.edu/~colallen/lp/lp.html (3 of 4)10/19/2005 2:02:25 AM
iu. (FUNCTIONS) r setf (MACRO) r symbolp (PREDICATE) r y-or-n-p.edu/~colallen/lp/lp. r © Colin Allen & Maneesh Dhagat Tue Feb 6..LISP Primer q list (FUNCTION) r listp (PREDICATE) r mapcar (FUNCTION) r max.html (4 of 4)10/19/2005 2:02:25 AM . 2001 http://mypage. etc. min (FUNCTIONS) r member (FUNCTION) r not (PREDICATE) r nth (FUNCTION) r nthcdr (FUNCTION) r null (PREDICATE) r numberp (PREDICATE) r or (MACRO) r read (FUNCTION) r reverse (FUNCTION) r second. third. yes-or-no-p (PREDICATES) About this document ..
LISP Primer
q
q
q
q
Checking for NIL s Logical Operators: And and Or r Exercises Recursion and Iteration r Recursive Definitions s A Simple Example s Using Trace To Watch Recursion s Another Example r Iteration Using Dotimes r Local Variables Using Let r Iteration Using Dolist r When To Use Recursion/When To Use Iteration r Tail Recursion r Timing Function Calls r Exercises Programming Techniques r A Word about LISP r Recursion on Simple Lists r Recursion on Nested Lists and Expressions r Recursion on Numbers r Ensuring Proper Termination r Abstraction r Summary of Rules r Exercises Simple Data Structures in LISP r Association Lists r Property Lists r Arrays, Vectors, and Strings s Arrays and Vectors s Strings r Defstruct r Exercises. Input and Output r Basic Printing r Nicer Output Using Format r Reading r Input and Output to Files r Converting Strings to Lists
s
http://mypage.iu.edu/~colallen/lp/ (2 of 4)10/19/2005 1:45:24 AM
LISP Primer
q
q
Functions, Lambda Expressions, and Macros r Eval r Lambda Expressions r Funcall r Apply r Mapcar r Backquote and Commas r Defmacro Appendix: Selected LISP primitives r * (FUNCTION) r + (FUNCTION) r - (FUNCTION) r 1+, 1- (FUNCTIONS) r = (PREDICATE) r <, >, <=, >= (PREDICATES) r and (MACRO) r append (FUNCTION) r apply (FUNCTION) r atom (PREDICATE) r butlast (FUNCTION) r car (FUNCTION) r caar, cadr, cdar, cddr, etc. (FUNCTIONS) r cdr (FUNCTION) r cond (MACRO) r cons (FUNCTION) r defun (MACRO) r do (SPECIAL FORM) r documentation (FUNCTION) r eql (PREDICATE) r eval (FUNCTION) r evenp, oddp (PREDICATES) r first (FUNCTION) r if (SPECIAL FORM) r length (FUNCTION) r let (SPECIAL FORM) r list (FUNCTION) r listp (PREDICATE) r mapcar (FUNCTION)
http://mypage.iu.edu/~colallen/lp/ (3 of 4)10/19/2005 1:45:24 AM
LISP Primer
q
max, min (FUNCTIONS) r member (FUNCTION) r not (PREDICATE) r nth (FUNCTION) r nthcdr (FUNCTION) r null (PREDICATE) r numberp (PREDICATE) r or (MACRO) r read (FUNCTION) r reverse (FUNCTION) r second, third, etc. (FUNCTIONS) r setf (MACRO) r symbolp (PREDICATE) r y-or-n-p, yes-or-no-p (PREDICATES) About this document ...
r
© Colin Allen & Maneesh Dhagat Tue Feb 6, 2001
http://mypage.iu.edu/~colallen/lp/ (4 of 4)10/19/2005 1:45:24 AM
LISt Processing
Contents Next: Background and Getting Up: LISP Primer Previous: Preface
LISt Processing
q q
q
q q q q
Background and Getting Started Basic Data Types r Atoms r Lists Some Primitive Functions r Constructors: Cons, List, and Append r Quote r Selectors: First and Rest Changing Variable Values More Functions and Predicates Setf Exercises
© Colin Allen & Maneesh Dhagat February 2005
http://mypage.iu.edu/~colallen/lp/node2.html10/19/2005 1:45:38 AM
LISP found many adherents in the artificial intelligence community. 2nd Edition. In the 1980s there was an attempt to standardize the language. you will be familiar with the concept of a compiler. Jr. For example: >(+ 1 2 3 4) 10 > In this example. the user typed the LISP expression (+ 1 2 3 4) and the interpreter responded with 10 and a new prompt. Digital Press. A compiler is a program that takes a complete program written in one of these languages and turns it into a set of binary instructions that the computer can process. The interpreter runs what is known as a read-eval-print loop. or Fortran.stanford. It was developed by John McCarthy in the late 1950s.edu/~colallen/lp/node3. Common LISP: The Language.html (1 of 2)10/19/2005 1:45:50 AM . and then prints the result.. T. There are many variants (or dialects) of LISP including Scheme. a prompt will appear. it immediately evaluates the expression entered and returns a response. http://mypage.edu/jmc/history/lisp/lisp. 1990).html. evaluates it. The result is Common LISP (see Guy L. If you are familiar with another programming language. LISP is usually used as an interpreted language. Unlike most languages.Background and Getting Started Contents Next: Basic Data Types Up: LISt Processing Previous: LISt Processing Background and Getting Started LISP is an acronym for LISt Processor. When you start up a LISP interpreter. it reads what you type. before providing another prompt. Steele. something like this: > The LISP interpreter waits for you to enter a well-formed LISP expression. Pascal. That is. Once you have entered an expression. Common LISP is now the most popular dialect. such as C.iu. This means that. and it is one of the oldest computer languages still in widespread use. etc. you start an interpreter which can process and respond directly to programs written in LISP. and his account of its history can be found at http://www-formal. unlike compiled languages.
iu. even between implementations of Common LISP. Contents Next: Basic Data Types Up: LISt Processing Previous: LISt Processing © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Do not go any further until you know how to start up and exit LISP on your system. If you need to. but (quit).Background and Getting Started In what follows. You will also need to know how to get out of the LISP interpreter. and (bye) are some common alternatives.html (2 of 2)10/19/2005 1:45:50 AM . (exit). This too varies. check the instructions for your LISP interpreter or ask a local person to find out how to get started. Exactly how to start LISP up will depend on the computer system you are using.edu/~colallen/lp/node3. it will be assumed that you have a LISP interpreter running in front of you.
http://mypage. Atoms are represented as sequences of characters of reasonable length. The rules for evaluating atoms and lists in LISP are very simple (one of the great beauties of the language). These two kinds are mutually exclusive. known as ``()'' or ``nil. They are covered in the next two sections.'' which is both an atom and a list. Examples: ATOMS LISTS a () john (a) 34 (a john 34 c3po) c3po ((john 34) a ((c3po))) Atoms and lists are both legal LISP expressions for the interpreter to read and evaluate.edu/~colallen/lp/node4.iu. with the exception of one special entity. This means that a given list may contain either atoms or other lists as members.Basic Data Types Contents Next: Atoms Up: LISt Processing Previous: Background and Getting Basic Data Types The two most important kinds of objects in LISP for you to know about are atoms and lists.html (1 of 2)10/19/2005 1:45:56 AM . Lists are recursively constructed from atoms. the empty list.
html (2 of 2)10/19/2005 1:45:56 AM .Basic Data Types q q Atoms Lists © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node4.iu.
234 and all the other numbers are special atoms in LISP -.html (1 of 3)10/19/2005 1:45:58 AM . to assign the value 9 to the atom ``my-age'' type the following to the interpreter: >(setq my-age 9) 9 . >my-age 9 . 10. 1. for instance. So. So. you assign 9 to the atom my-age . The interpreter considers nil to be identical to the empty list. you may test what you have done by giving the atom to the interpreter.Atoms Contents Next: Lists Up: Basic Data Types Previous: Basic Data Types Atoms The first rule of evaluation is that for any atom the evaluator. interpreter responds with value Now.edu/~colallen/lp/node5. In addition to numbers. you can change the value of my-age as follows: >(setq my-age 10) 10 >my-age 10 9. and it will respond by repeating the number. known as ``eval. you tell interpreter to eval my-age . http://mypage. it responds with the set value If a birthday has just passed.iu. t and nil (think of them as true and false respectively). setf. Typing () directly to the interpreter will cause it to respond with nil. For most atoms. eval will return an error unless you have previously assigned a value to it. two other special atoms are predefined.'' attempts to find a value for that atom. To assign a value to an atom use setq (or you can use its more sophisticated cousin. more on setf in later chapters).they are pre-defined to evaluate to themselves. you may give any number to the interpreter.
Constants (such as t and nil) are a subcategory of symbol. Error signalled by EVAL. >(setq 1 2) Error: 1 is not a symbol. Notice that it is an error to attempt to set a value for special atoms: numbers. or nil. >(setq t nil) Error: Cannot assign to the constant T. From these error messages you can see that the interpreter distinguishes between symbols. Error signalled by SETQ. numbers.Atoms Try the following sequence: >9 9 >10 10 >my-age 10 >t T >nil NIL >() NIL >your-age Error: The variable YOUR-AGE is unbound.html (2 of 3)10/19/2005 1:45:58 AM .edu/~colallen/lp/node5. So we will ignore what is going on when an error occurs and assume that you can just carry on giving expressions to the interpreter for evaluation. the LISP interpreter continues to evaluate LISP expressions normally. Most LISP systems throw you into a debugger mode when an error occurs. but all will say something about an unbound variable). Only symbols which are not constants may be assigned a value with setq. Error signalled by SETQ. t.iu. (The exact error message will vary between versions of LISP. Numbers and symbols are mutually exclusive subcategories of atoms. From the debugger you can find out lots of useful things about the state of the interpreter when the problem occurred. constants. Unfortunately. http://mypage. Even in debugger mode. LISP debuggers are not at all standardized so it is impossible to give a description here. although the prompt usually is different. The last item illustrates what happens if you try to evaluate an atom that has not been set to a value.
iu.edu/~colallen/lp/node5.html (3 of 3)10/19/2005 1:45:58 AM .Atoms Contents Next: Lists Up: Basic Data Types Previous: Basic Data Types © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
The interpreter treats any list as containing the name of a function followed by the arguments to the function. eval finds values for all the arguments.html (1 of 2)10/19/2005 1:45:59 AM . http://mypage. unless you had previously defined foo to be a function. for example. Also. However: >(+ your-age 1) will generate an error (unbound variable your-age). typing >(foo 1 3 4) causes an error (undefined function foo). the interpreter applied the function + to the evaluated arguments and return with the value 60.. You could also enter: >(+ my-age 1) 11 This works fine because my-age is evaluated and the value 10 is found (assuming you did just what was described in the section above). and everyone is happy. Schematically then. if you attempt to use something that is not a function. try the following: >(+ 2 13 45) 60 In this case. (More on defining functions in a later chapter).Lists Contents Next: Some Primitive Functions Up: Basic Data Types Previous: Atoms Lists The second rule of evaluation concerns lists. Since the numbers are predefined.edu/~colallen/lp/node6.iu.. So. a list is read like this: (name-of-function first-argument second-argument .) For example. you will generate an error message.
iu.Lists © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node6.html (2 of 2)10/19/2005 1:45:59 AM .
Some Primitive Functions Contents Next: Constructors: ConsList. max.'' There are (of course) lots of primitive functions in LISP. min. More important to the list-processing identity of LISP are the primitive functions that allow selection from lists and construction of lists. exp.iu. log. cos. and Append Quote Selectors: First and Rest © Colin Allen & Maneesh Dhagat February 2005 http://mypage. *. Here's a list of some of the more common math functions: +. including all the math functions you would expect. list. tan. The important constructor functions are cons. expt. sqrt. List. and append. q q q Constructors: Cons. -.edu/~colallen/lp/node7. You should look at the appendix entries for these functions and play with them to learn how they work. Up: LISt Processing Previous: Lists Some Primitive Functions Functions that are built into the LISP language are called ``primitive functions.html10/19/2005 1:46:00 AM . sin. /. The two principal selector functions are first and rest.
'' Now we discuss what happens when we deal with atoms that are not special. To understand the second example. So. cons takes the first argument and inserts it as the first element of the second. 2 and nil. ``OK. which. List. e. 1 and (cons 2 nil). So.e. It says.edu/~colallen/lp/node8. cons is given two arguments. 2 evaluates to 2. cons. you will remember.Constructors: Cons. and there are two arguments to that function. is the same as (). cons I know. and Append Contents Next: Quote Up: Some Primitive Functions Previous: Some Primitive Functions Constructors: Cons. and Append The primitive function ``cons'' allows you to add a member to the front of a list. putting 2 into the empty list we get (2). eval a. i. so its first element names a function. 1. Here are two examples: >(cons 1 nil) (1) >(cons 1 (cons 2 nil)) (1 2) It is worth looking at what is going on in these examples. Hence we get (1 2). First. List. The first is 1 and the second is nil. and nil evaluates to nil (the empty list).iu. i. the interpreter would say ``OK.'' Immediately you get an error because (we are assuming) a is an unbound variable (you haven't set it to anything). but a special one. cons is a function I know and I've got two arguments to that function. In the first. and evaluates to 1. The second is a list.html (1 of 2)10/19/2005 1:46:01 AM . we can go ahead and insert the first argument. Suppose you wanted to construct the list (a b c d) and you try to do this by saying: >(cons a (b c d)) What would happen? Well. How do you fix this problem? http://mypage. The first argument is an atom. it is useful to anthropomorphize the interpreter. and I've got two arguments to evaluate. Now I know what the second argument to the first cons is.
List.html (2 of 2)10/19/2005 1:46:01 AM .iu. and Append © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node8.Constructors: Cons.
In fact. forgetting to put) the quote on the first argument. the interpreter does not evaluate it if it is an atom.iu. in front of an item that you do not wish the interpreter to evaluate. the first argument -. that in using setq. but this still won't work since the interpreter tries to evaluate the second argument (b c d). So (setq a 4) is really short for (set (quote a) 4). It works as follows: >'a a Without the quote you would have received an error message. Shorthand commands like setq and ' are called ``macros'' by programmers.) http://mypage.'' The use of dotted pairs is relatively rare and will be ignored here.edu/~colallen/lp/node9. so they wrote setq to take care of it automatically (now you understand the name. right?!) So. but the first can be either an atom or a list. more likely. Cons always takes two arguments.the variable to be set -. Notice. LISP had only the function set. treating b as the name of a function. so it is an error. '. the second argument is a list.html (1 of 2)10/19/2005 1:46:03 AM . But (we are assuming) you have not defined b to be a function. (Cons can be used with an atom as the second argument.Quote Contents Next: Selectors: First and Up: Some Primitive Functions Previous: Constructors: ConsList. What gets returned is a slightly esoteric data type called a ``dotted pair. The interpreter expands 'a to the expression (quote a).does not need a quote. LISP programmers got tired of putting (or. Once again you can use the ' to block evaluation of the list (b c d). Quote The answer to the previous question is to use the single quote mark. whose proper use included things like (set 'a 4) or (set 'a 'b).) Usually. so you don't need quotes on the internal elements of the list. Thus: >(cons 'a '(b c d)) (a b c d) Notice that you need only one quote on the second argument. (setq a 4) is equivalent to (set 'a 4). So now you might try (cons 'a (b c d)). (Try it with one or three and see that you get an error message. Originally. The quote blocks evaluation of the whole thing. the ' itself is shorthand for another function. also.
Contents Next: Selectors: First and Up: Some Primitive Functions Previous: Constructors: ConsList. resulting in a dotted pair. For example: >(list 2 3 4) (2 3 4) >(list 'a '(a s d f)) (a (a s d f)) Make sure you understand why list works as shown in these examples. (Only the last argument may be an atom. Arguments to list will typically be either atoms or lists. List takes all its arguments and makes a list with them as elements.) When used with lists.Quote The list building functions list and append both allow arbitrary numbers of arguments. append has the effect of taking all the members of the lists that are its arguments and creating a new list from those elements. For example: >(append '(a b) '(c d)) (a b c d) Beginning LISP programmers (and even some experienced ones) frequently have trouble deciding whether they should use cons or list or append to achieve a particular effect.iu.html (2 of 2)10/19/2005 1:46:03 AM .edu/~colallen/lp/node9. The best way to get around the difficulty is to play with the different functions and see what works. © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Append is normally used with lists as arguments.
respectively. (You can still use the old names in Common LISP. Historically.html (1 of 2)10/19/2005 1:46:04 AM .iu. but these names were hard to explain since they referred to the contents of various hardware registers in computers running LISP.Selectors: First and Rest Contents Next: Changing Variable Values Up: Some Primitive Functions Previous: Quote Selectors: First and Rest There are two primitive list selectors. So: >(first a) a >(rest a) http://mypage. In Common LISP the functions have been given alternative names. It works like this: >(first '(a s d f)) a >(first '((a s) d f)) (a s) Rest takes a list as an argument and returns the list. >(rest '(a s d f)) (s d f). One of us learned LISP in the old days. these were known as car and cdr. so occasionally we'll use car or cdr instead of first or rest.) First takes a list as an argument and returns the first element of that list. minus its first element. >(rest '((a s) d f)) (d f) >(rest '((a s) (d f))) ((d f)) You can use setq to save yourself some typing. first and rest.edu/~colallen/lp/node10. Do the following: >(setq a '(a s d f)) (a s d f) You can now use a instead of repeating the list (a s d f) every time.
like how to get at the third and fourth elements of the list using first and rest.html (2 of 2)10/19/2005 1:46:04 AM .iu.Selectors: First and Rest (s d f) >(first (rest a)) s You can figure out the rest.edu/~colallen/lp/node10. © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
Changing Variable Values Contents Next: More Functions and Up: LISt Processing Previous: Selectors: First and Changing Variable Values What happens to the value of a. and cons you can do anything you want to with lists. it would be useful to make these changes stick sometimes. and cons as in the examples that used append and list.edu/~colallen/lp/node11. rest. That is. These primitives are sufficient. We'll let you play with the possibilities here. © Colin Allen & Maneesh Dhagat February 2005 http://mypage.although they are very convenient. it looks like this: >(cons 'a a) (a a s d f) >a (a s d f) Obviously. try to achieve the same effects using just first.html10/19/2005 1:46:05 AM . but using setq with just the three functions first. Append and list are strictly superfluous -. To do that you can use setq as follows: >(setq a (cons 'a a)) (a a s d f) >a (a a s d f) and henceforth. after saying (cons 'a a)? Nothing. above. For practice.iu. that is the new value of a. rest.
iu.html (1 of 2)10/19/2005 1:46:06 AM . >(length 3 >(length 5 >(length 10 >(length 3 >(length 2 '(1 2 3)) a) (append a a)) '(append a a)) (list a a)) Predicates are functions that always return either t or nil. Atom is a predicate that determines whether its argument is an atom. there is a function called.More Functions and Predicates Contents Next: Setf Up: LISt Processing Previous: Changing Variable Values More Functions and Predicates To find out the length of a list.edu/~colallen/lp/node12. Constantp is less frequently used. and nil otherwise. Symbolp and numberp are also useful predicates. It takes a single argument which should be a list. NIL. >(atom 'a) T >(atom a) NIL >(listp 'a) NIL >(listp a) T Find out for yourself how atom and listp work with the empty list. Listp returns t if its argument is a list. http://mypage. but might come in handy some time. length. appropriately enough. Experiment with them to find out how they work.
. reverse. 2003 http://mypage.html (2 of 2)10/19/2005 1:46:06 AM . cddr.edu/~colallen/lp/node12. caar. last. third. together with the LISP interpreter. constantp..iu. butlast. fourth.. integerp.. nbutlast. to figure out how these functions and predicates work: second. cadr. cdar. nthcdr.More Functions and Predicates Use the appendix entries. © Colin Allen & Maneesh Dhagat Jan 19.
What you need is a way to change just part of a list.edu/~colallen/lp/node13. setf is what you need. you could say >(setq words (cons 'this (rest words))) (THIS LIST OF WORDS) but with lengthy list structures this can get complicated.iu.Setf Contents Next: Exercises Up: LISt Processing Previous: More Functions and Setf Setq is useful for changing the values of variables. Suppose you assign a value to a variable as follows: >(setq words '(a list of words)) (A LIST OF WORDS) What if you want to change just part of the list that is the value of words? Well. For example: >(setq my-age (+ my-age 1)) 11 >(setq a (cdr a)) (a s d f) LISP programs very frequently make use of changes of this sort. But sometimes one would like to change just part of the value of a variable. >(setf (first words) 'the) THE >words (THE LIST OF WORDS) >(setf (third words) 'is) IS >words (THE LIST IS WORDS) >(setf (rest words) '(game is up)) (GAME IS UP) http://mypage. Look at this sequence to see just some of the ways in which it can be used.html (1 of 2)10/19/2005 1:46:08 AM .
Setf >words (THE GAME IS UP) Now you know enough to do the exercises below.html (2 of 2)10/19/2005 1:46:08 AM . © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node13.iu.
(append '(my life as) '(a dog)) g. (cons (rest nil) (first nil)) i. Evaluate the following: a.iu. (first '(rest (rest (a b c)))) e. try to figure it out by playing with some slight variations of the problems. If you don't understand why the interpreter responds in some way.edu/~colallen/lp/node14.html (1 of 3)10/19/2005 1:46:09 AM . (abs (.Exercises Contents Next: Defining LISP functions Up: LISt Processing Previous: Setf Exercises Note: A temptation if you are not used to computers is to sit down and try to work out these exercises in your head and be satisfied when you have reached some answer or other. 1. (reverse (cons '(rest (reverse '(its gut na mur ta give captin))))) 2. (first '(((a)) (b c d e))) b. Using first and rest extract the atom ``jim'' from the following: http://mypage. (first '(rest (a b c))) d. think about why the error occurs and how you might change things to eliminate it.(length (rest '(((a b) (c d))))) 5)) j. Some of the examples below (intentionally) generate interpreter errors. (rest '(((((f)))))) c. DON'T! Use the LISP interpreter to check your understanding. (cons '(my life as) '(a dog)) f. In such cases. (list '(my life as) '(a dog)) h.
(setf trek (cons 'data trek)) f.iu. (watergate and no viewer) d. (no broccoli please) b.Exercises a. ((scorsese and deniro) are no robert kennedy) c. (setf trek '(picard riker laforge worf)) b. (length (cons 'troi trek)) 4. trek d. (cons 'data trek) c. a. (he is dead jim) b. http://mypage. Given the following definition: (setf mylist '((bush broccoli) (nixon watergate) (letterman (viewer mail)) (you are no jack kennedy) (and please) (scorsese (robert deniro)))) Construct the following with any of the functions you have learned so far. (captain (((jim) kirk))) c. (((((spock) asked) jim) if) he was all right) d.edu/~colallen/lp/node14. (length (cons 'troi trek)) e.html (2 of 3)10/19/2005 1:46:09 AM . (bush nixon kennedy) e. (after (looking at the (lizard man) ((((jim))) asked for warp 9))) 3. What is returned by each of the following expressions (assume they are evaluated in the given order)? a.
Exercises ((bush broccoli) (nixon watergate) (letterman mail)) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html (3 of 3)10/19/2005 1:46:09 AM .edu/~colallen/lp/node14.iu.
edu/~colallen/lp/node15.Defining LISP functions Contents Next: Defining Functions: Defun Up: LISP Primer Previous: Exercises Defining LISP functions q q q q q q q q Defining Functions: Defun Local and Global Variables Using an Editor Using Your Own Definitions in New Functions Functions with Extended Bodies Conditional Control r If r Cond More Predicates and Functions r Equality Predicates r Checking for NIL r Logical Operators: And and Or Exercises © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html10/19/2005 1:47:06 AM .iu.
(Recall: T and nil are constants. the second is a list of parameters for the function. The number of symbols in the parameter list determines the number of arguments that must be passed to the function when it is called. http://mypage.edu/~colallen/lp/node16. LISP instructions that tell the interpreter what to do when the function is called.iu. pi is also given as a predefined constant that may not be set. Check this out by typing (square 2 3) or (square). etc.html (1 of 2)10/19/2005 1:47:21 AM . Schematically then. The symbols in this list must be variables. and the third is the body of the function -. otherwise an error message will occur.) It is even possible to redefine LISP's predefined functions such as first. Defun requires you to provide three things.i.) In some versions of LISP. not constants. (Recall: A symbol is any atom that is not a number. Avoid doing this! For present purposes.0000063289696399 The name of a user-defined function can be any symbol. cons. the parameter list should be a list of symbols.Defining Functions: Defun Contents Next: Local and Global Up: Defining LISP functions Previous: Defining LISP functions Defining Functions: Defun Use defun to define your own functions in LISP.e. a function definition looks like this: (defun <name> <parameter-list> <body>) Here is an example of a function to calculate the square of a number. The function square must be given exactly one argument. It is short enough to be typed directly at the interpreter's prompt: >(defun square (x) (* x x)) SQUARE >(square 2) 4 >(square 1. The first is the name of the function.4142158) 2.
Simple. or it can be an indefinitely long set of instructions. The advantage of this technique is that the building blocks can be written and tested separately. so we like it here.edu/~colallen/lp/node16. Other symbols would have worked just as well in the definition of square.iu. Even though we don't want the interpreter to evaluate the name. The use of these will not be covered here. &optional. Choosing to use number-to-be-squared for the name of the variable would soon get tiresome after you had mistyped it for the umpteenth time! The body of a function can be a single LISP instruction.html (2 of 2)10/19/2005 1:47:21 AM . for example).Defining Functions: Defun (More advanced programming allows the use of &rest. but sometimes it makes more sense to use something like nmbr that can play a mnemonic role when you look back at your code. notice that none of them requires a quote. Contents Next: Local and Global Up: Defining LISP functions Previous: Defining LISP functions © Colin Allen & Maneesh Dhagat February 2005 http://mypage.) Inside the parameter list. and body components when the function is being defined. Defun. Good programming technique also includes building small functions that perform specialized tasks and then using those as building blocks for more complicated tasks. takes care of this automatically. You are referred to Steele for details. parameters. &key in the parameter list to permit variable numbers of arguments. x is short. short functions are much easier to debug than 30-line monsters. x is used as a variable to stand for whatever argument is provided when square is called. like setq and setf. Good programming style dictates that you keep the body of a function reasonably short (short enough to read on one screen.
The body of a function definition implicitly constitutes a code block. If a local value for the variable does not exist.Local and Global Variables Contents Next: Using an Editor Up: Defining LISP functions Previous: Defining Functions: Defun Local and Global Variables An important question that might occur to you is what would happen if you had set x to have some value.e.. before using the function square? Try it out: >(setf x 3) 3 >(square 345) 119025 >x 3 Setting x to 3 has no effect on the operation of square -. in this case x is a local variable while the block (* x x) is evaluated.html (1 of 3)10/19/2005 1:47:24 AM . The values of local variables are defined only relative to a certain ``block'' of code..edu/~colallen/lp/node17. ``Local'' means that functions other than square do not know about this value for x. the interpreter assigns 345 as the value of x that is local to the function square. Global variables have values that can be accessed by any function. the local value of x no longer is stored.. e. and the only value of x the interpreter knows about is its global value.neither does the function square have a (lasting) effect on the value of x. Inside the body of square the local value of x (e. 3. When you make a call to a square.g. i. (square 345). In the definition of square. 345) is preferred to the global value (e.g.g. If no global http://mypage. then a global value is sought. The rule the interpreter follows for evaluating symbols is that inside code blocks local values are always looked for first. As soon as (square 345) returns 119025. 3) that you gave it at the top level. the variable list (x) tells the interpreter what variables are local to the body of the function. This is because the interpreter makes a distinction between local variables and global variables.iu.
The distinction between local and global variables is very important. First define the following function: >(defun y-plus (x) (+ x y)) Y-PLUS If you have not assigned a value to y. then typing (y-plus 2) will give an error (unbound variable y).edu/~colallen/lp/node17. Local variables disappear when the function that uses them is done. Now do the following: >(setq y 2) 2 >(y-plus 4) 6 >(setq x 5) 5 >(y-plus 23) 25 >x 5 >(setq y 27) 27 >(y-plus 43) 70 Go through these examples (and try out others) to make sure you understand why they behave as shown. If LISP is not your first programming language one of the most likely signs of an ``accent'' from the other language(s) is the overuse of global variables. and we will come back to it several times. http://mypage. Good LISP programmers use local variables as much as they can. Global variables hang around for ever.iu.Local and Global Variables value is found then the result is an error.html (2 of 3)10/19/2005 1:47:24 AM . rather than using global ones. This precedence order can be seen with the following example. so they take up more memory.
html (3 of 3)10/19/2005 1:47:24 AM .edu/~colallen/lp/node17.Local and Global Variables Contents Next: Using an Editor Up: Defining LISP functions Previous: Defining Functions: Defun © Colin Allen & Maneesh Dhagat February 2005 http://mypage.iu.
iu.html (2 of 2)10/19/2005 1:47:26 AM .Using an Editor You are not recommended to go any further in this chapter until you know how to use a program editor on your computer.edu/~colallen/lp/node18. Contents Next: Using Your Own Up: Defining LISP functions Previous: Local and Global © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
First.html10/19/2005 1:47:27 AM . Each time square is called. x is restored to whatever global value it previously had. During the computation. © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Finally. and again with the argument 4.edu/~colallen/lp/node19. Fourth-power evaluates (square (square 2)).iu. a local version of x is bound to the appropriate value.Using Your Own Definitions in New Functions Contents Next: Functions with Extended Up: Defining LISP functions Previous: Using an Editor Using Your Own Definitions in New Functions User-defined functions can be included in new function definitions. For example: >(defun fourth-power (x) (square (square x))) FOURTH-POWER >(fourth-power 2) 16 It is worth paying attention to what happens when fourth-power is called. x is bound to 2. which is its local value for the function fourth-power. the variable ``x'' gets assigned as many as four times. which means that square is called once with the argument 2.
Powers-of does not have any side effects as it is. one after the other.Functions with Extended Bodies Contents Next: Conditional Control Up: Defining LISP functions Previous: Using Your Own Functions with Extended Bodies As mentioned before. which has two: >(defun powers-of (x) (square x) (fourth-power x)) POWERS-OF >(powers-of 2) 16 Notice that this function only returns the value of the last expression in its body. Take the following definition. What is the point of having more than one expression in the body of a function if it only ever returns the last? The answer to this question is that we may be interested in side effects of the intermediate evaluations.html (1 of 2)10/19/2005 1:47:28 AM . but change the definition as follows: >(defun powers-of (x) (setq y (square x)) (fourth-power x)) POWERS-OF Watch what happens here: >y 27 >(powers-of 7) http://mypage. In this case the last expression in the body is (fourth-power x) so only the value 16 gets printed in the example above. a function definition may contain an indefinite number of expressions in its body.edu/~colallen/lp/node20.iu.
html (2 of 2)10/19/2005 1:47:28 AM . and the effect of the set lasts beyond the life of your call to powers-of. it is treated as a global variable.iu.Functions with Extended Bodies 2401 >y 49 The side effect of powers-of was to set the value of the variable y to 49. Since y did not appear in the parameter list of powers-of.edu/~colallen/lp/node20. © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
iu.html10/19/2005 1:47:30 AM .Conditional Control Contents Next: If Up: Defining LISP functions Previous: Functions with Extended Conditional Control q q If Cond © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node21.
g. (A S D F).If Contents Next: Cond Up: Conditional Control Previous: Conditional Control If An if statement has the form: (if <test> <then> <else>) The test. e. i. otherwise it returns the result of evaluating the else expression. then the expression (.y x) gets evaluated. If the evaluation of the test expression returns anything other than nil.g.x y) (..y x))) If x is greater than y. returns T.e. symbols or lists.iu.edu/~colallen/lp/node22. Here it is: (defun absdiff (x y) (if (> x y) (. We can use if to define a function to return the absolute difference between two numbers.e. FOO.x y). by making use of the predicate > (greater than). which gives the positive difference. in this case (. T. the interpreter evaluates the then expression and returns its value. 3. If x is less than or equal to y.html10/19/2005 1:47:31 AM . which will return 0 or a positive difference. so the then clause is evaluated. © Colin Allen & Maneesh Dhagat February 2005 http://mypage. then the test. (> x y). and else expressions can be any evaluable Lisp expressions -. then.
It is common to put t as the test for the last clause since this means that the last clause always will act as http://mypage. This could be coded using if as follows (schematically): (if A B (if C D E)) This is not too bad. <resulta>) (<testb> <form1b> <form2b> .. <resultb>) . <resultk>)) We will call each of the lines (<test>. or sometimes just ``clause'' for short..... only the test is required... If the test returns a non-nil value. but sometimes one would like to have multiple branching conditions. Instead of nesting if statements as before.. all the other expressions in that clause are evaluated.. (<testk> <form1k> <form2k> .g. (The intermediate forms are. E. only useful for producing side-effects.<result>) a ``cond clause''. But things can get a lot worse if you want to have a long chain of test conditions.iu. then the rest of the clause is not evaluated. LISP provides a very convenient macro called cond for such situations. then do D.. if condition A is met then do B. The general form of a cond statement is as follows: (cond (<testa> <form1a> <form2a> . but if neither condition A nor C is met then do E.Cond Contents Next: More Predicates and Up: Conditional Control Previous: If Cond If is useful. the set of conditions (if A B (if C D E)) can be expressed using cond. It would look like this: (cond (A B) (C D) (t E)) A through E can be any LISP expressions at all..edu/~colallen/lp/node23. but if condition A is not met but condition C is met.. but most commonly cond clauses contain just two elements: test and result. In cond clauses. therefore. If the evaluation of the test expression at the beginning of a clause returns nil.html (1 of 2)10/19/2005 1:47:33 AM . and the value of the last one is returned as the value of the entire cond statement.
Cond
a default if none of the other tests succeed. Here's a simple example, using cond instead of if, defining absdiff to act as before: (defun absdiff (x y) (cond ((> x y) (- x y)) (t (- y x)))) Notice the double left parenthesis immediately following cond in this example. A common beginner's programming error is to omit one of these, but both are required since the test in this cond clause is (> x y). With just one parenthesis, the cond statement would attempt to treat the symbol > as the test, which would result in an unbound variable error. Conversely, there is only one left parenthesis in front of the t in the second clause. Again, the explanation is that the test is to evaluate the constant t. Cond and if statements are most powerful in defining functions that must repeat some step or steps a number of times. In the next chapter, you will see how cond and if are essential for giving recursive function definitions which exploit the power of LISP to solve repetitive problems. Before we can exploit that potential, it will be necessary to learn some more commonly used predicates and functions, that serve well as test statements.
Contents Next: More Predicates and Up: Conditional Control Previous: If
© Colin Allen & Maneesh Dhagat February 2005
http://mypage.iu.edu/~colallen/lp/node23.html (2 of 2)10/19/2005 1:47:33 AM
More Predicates and Functions
Contents Next: Equality Predicates Up: Defining LISP functions Previous: Cond
More Predicates and Functions
q q q
Equality Predicates Checking for NIL Logical Operators: And and Or
© Colin Allen & Maneesh Dhagat February 2005
http://mypage.iu.edu/~colallen/lp/node24.html10/19/2005 1:47:34 AM
Equality Predicates
Contents Next: Checking for NIL Up: More Predicates and Previous: More Predicates and
Equality Predicates
Common LISP contains a number of equality predicates. Here are the four most commonly used: = (= x y) is true if and only x and y are numerically equal. equal As a rule of thumb, (equal x y) is true if their printed representations are the same (i.e. if they look the same when printed). Strictly, x and y are equal if and only if they are structurally isomorphic, but for present purposes, the rule of thumb is sufficient. eq (eq x y) is true if and only if they are the same object (in most cases, this means the same object in memory). eql (eql x y) is true if and only if they are either eq or they are numbers of the same type and value. Generally = and equal are more widely used than eq and eql. Here are some examples involving numbers: >(= 3 3.0) T >(= 3/1 6/2) T >(eq 3 3.0) NIL >(eq 3 3) T or NIL (depending on implementation of Common LISP)
http://mypage.iu.edu/~colallen/lp/node25.html (1 of 3)10/19/2005 1:47:35 AM
Equality Predicates
>(eq 3 6/2) T >(eq 3.0 6/2) NIL >(eql 3.0 3/1) NIL >(eql 3 6/2) T >(equal 3 3) T >(equal 3 3.0) T Suppose now we have the following variable assignments: >(setf a '(1 2 3 4)) (1 2 3 4) >(setf b '(1 2 3 4)) (1 2 3 4) >(setf c b) (1 2 3 4) Then: >(eq a b) NIL >(eq b c) T >(equal a b) T >(equal b c) T
http://mypage.iu.edu/~colallen/lp/node25.html (2 of 3)10/19/2005 1:47:35 AM
you will want to use either = or equal.html (3 of 3)10/19/2005 1:47:35 AM . © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Eql is used by advanced programmers. and fortunately these are the easiest to understand. Next most frequently used is eq.Equality Predicates >(eql a b) NIL >(eql b c) T >(= (first a) (first b)) T >(eq (first a) (first b)) T or NIL (depending on implementation of Common LISP) >(eql (first a) (first b)) T In most cases.edu/~colallen/lp/node25.iu.
.iu.html10/19/2005 1:47:37 AM .preferable to use not .preferable to use null .preferable to use null © Colin Allen & Maneesh Dhagat February 2005 http://mypage. otherwise use not: >(null nil) T >(not nil) T >(null ()) T >(not ()) T >(null '(a s)) NIL >(not '(a s)) NIL >(not (= 1 (* 1 1))) NIL >(null (= 1 (* 1 1))) NIL .edu/~colallen/lp/node26. Good programming style dictates that you use null when the semantics of the program suggest interest in whether a list is empty..Checking for NIL Contents Next: Logical Operators: And Up: More Predicates and Previous: Equality Predicates Checking for NIL The predicates null and not act identically..
iu. but only enough arguments to provide a definitive result are evaluated. some arguments to and and to or may not be evaluated at all. If all the arguments evaluate to nil. otherwise it returns the value of its last argument. and does not evaluate the rest of its arguments. For example: >(and 1 2 3 4) 4 >(and 1 (cons 'a '(b)) (rest '(a)) (setf y 'hello)) NIL In the example immediately above. http://mypage. You can check this out by evaluating y directly: >y 27 Or returns the result of its first non-nil argument.html (1 of 2)10/19/2005 1:47:38 AM . Examples: >(or nil nil 2 (setf y 'goodbye)) 2 >(or (rest '(a)) (equal 3 4)) NIL Once again.Logical Operators: And and Or Contents Next: Exercises Up: More Predicates and Previous: Checking for NIL Logical Operators: And and Or And and or are functions but not predicates since they may return values other than t or nil. then or returns nil. So. And returns nil as soon as it finds an argument which evaluates to nil. you will see that y's value is unchanged by these examples. Each evaluates its arguments in the order they appear. the expression (setf y 'hello) is never evaluated since (rest '(a)) returns nil.edu/~colallen/lp/node27.
Logical Operators: And and Or © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node27.html (2 of 2)10/19/2005 1:47:38 AM .iu.
<=. and after this command? 3. Consider the following function definition: (defun who-knows (lst1 lst2) (cond ((= (length lst1) (length lst2)) (+ (length lst1) (length lst2))) ((> (length lst1) (length lst2)) (length lst2)) (t (length lst1)))) http://mypage. numberp.Exercises Contents Next: Recursion and Iteration Up: Defining LISP functions Previous: Logical Operators: And Exercises 1. zerop. <.html (1 of 3)10/19/2005 1:47:40 AM . during. functionp 2.edu/~colallen/lp/node28. atom. listp. symbolp. =. constantp.iu. Consider the following definition: (defun life (a b) (cond ((null a) b) ((null b) a) (t 'its-tough))) Suppose you are running the LISP interpreter and you enter the following: >(setf a 'oh-boy) Then you do the following: >(life 'gummi a) What are the global and local values of a and b before. Use the LISP interpreter to help you learn or refresh your memory about the behavior of these predicates: >. >=.
How would you make this function crash (return an ERROR)? Be careful in explaining why it will happen. if a list is passed in it should return the proper length. What does this function do? Be precise as what would happen in each case.edu/~colallen/lp/node28. b. Thus it should work as follows: >(circulate-dir '(1 2 3 4) 'left) (4 1 2 3) http://mypage. 4. it should identify them as such. or another type of atom is passed in. Consider the following definition for the function CIRCULATE: (defun circulate (lst) (append (rest lst) (list (first lst)))) This function takes a list and constructs a new list by taking the first element of the old list and making it the last element of the new. Write a function called BLENGTH (B stands for better) which is more tolerant of bad arguments. For example: >(circulate '((whats) happening here)) (happening here (whats)) Rewrite the function and call it CIRCULATE-DIR so that it can circulate lists in both directions. It works as follows: >(blength '(a b c d)) 4 >(blength 'hello) (sorry hello is an atom) >(blength 4) (sorry 4 is a number) Thus. and is more informative.iu. 5.Exercises a.html (2 of 3)10/19/2005 1:47:40 AM . else if a number.
Define a function called MY-AND which acts like the LISP AND function (but only takes 2 arguments) using only IF.Exercises >(circulate-dir '(1 2 3 4) 'right) (2 3 4 1) 6. © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node28. (circulate 'hello) b. (circulate nil) 7. With the definition of CIRCULATE given above.html (3 of 3)10/19/2005 1:47:40 AM . what happens (and explain why) when we evaluate a.iu.
LISP provides two paradigms for controlling repetition -.edu/~colallen/lp/node29.Recursion and Iteration Contents Next: Recursive Definitions Up: LISP Primer Previous: Exercises Recursion and Iteration Many. uses for computers involve repetitive procedures. if not most. q q q q q q q q Recursive Definitions r A Simple Example r Using Trace To Watch Recursion r Another Example Iteration Using Dotimes Local Variables Using Let Iteration Using Dolist When To Use Recursion/When To Use Iteration Tail Recursion Timing Function Calls Exercises © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Also in this chapter you will find out how to set up code blocks with local variables using let.both covered in this chapter.html10/19/2005 1:48:04 AM .iu.recursion and iteration -.
edu/~colallen/lp/node30.iu.Recursive Definitions Contents Next: A Simple Example Up: Recursion and Iteration Previous: Recursion and Iteration Recursive Definitions q q q A Simple Example Using Trace To Watch Recursion Another Example © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html10/19/2005 1:48:14 AM .
as (* 3 (power 3 3)). Since y is not equal to zero.html (1 of 2)10/19/2005 1:48:18 AM .) Use an editor to enter the definition of power given above and evaluate it in the LISP interpreter. the result is 81. There is a corresponding function 1+. How can a function make use of itself in its own definition? To understand this. Then the if statement is evaluated. it may result in more calls to itself. As before. Eventually the first call to power (the ``top-level'' call) is able to finish its multiplication. Obviously. This time. look at this definition of a function to calculate x to the power of y (for positive integer values of y): (defun power (x y) (if (= y 0) 1 (* x (power x (1. this multiplication cannot be completed without first calculating (power 3 3). another call to power is made. its arguments are 3 and 0.y))))) The else clause of the if statement in this definition contains a reference to power. so the expression (* 3 (power 3 2)) needs to be evaluated. Now the previous call to power (the fourth one) is able to complete the multiplication (* 3 (power 3 0)) and returns 3 to the next level up. (As always. When (power 3 4) is evaluated. the local variables x and y are set to 3 and 4 respectively. http://mypage. It is important to realize that these new values of x and y are local only to the second call to power -. when called. For example. and that you experiment with the examples we give.y))) is evaluated. the test clause of the if statement is false. we assume that you have a machine running LISP in front of you.) This is the same. let's examine how power works when it is called. the expression (* x (power x (1.the previous call knows nothing about them. x and y are both 3. this time the test clause is true. which results in a third call to power with x equal to 3 and y equal to 2.edu/~colallen/lp/node31. and so on.iu. So. Here is what happened. 1.A Simple Example Contents Next: Using Trace To Up: Recursive Definitions Previous: Recursive Definitions A Simple Example The distinctive feature of a recursive function is that. The fifth time that power gets called. and neither will any subsequent call.is a function that decrements its argument by 1. then. Now enter the following expression at the interpreter's prompt: >(power 3 4) 81 All well and good. so (power 3 0) returns 1 and the recursion stops.
the termination condition (given in the test clause of the definition) is that the second argument is 0. a new level of recursion is created. If you exceed the limit. at least provide an informative error message.) Contents Next: Using Trace To Up: Recursive Definitions Previous: Recursive Definitions © Colin Allen & Maneesh Dhagat February 2005 http://mypage. what would happen if you called this version of power with y as a negative number or a noninteger as the second argument.edu/~colallen/lp/node31. and how easy it is to change it. will depend on the particular version of LISP you are using. A robust power function would do something appropriate with negative or noninteger second arguments. you will see an error message saying something like ``Function call stack overflow. You want to make sure your program will terminate! Were it not for the stack overflow. The termination condition is the most important part of a recursive definition. since it is not always safe to assume that whoever uses power will be careful not to make y negative or an integer. a bad terminate condition would result in an infinite spiral. Think too.html (2 of 2)10/19/2005 1:48:18 AM . Is there a limit to how deep the recursion can go? The answer is yes. Any recursive function will cause a stack overflow if it does not have a proper termination condition.A Simple Example Each time power is called recursively. like provide the correct answer! (Or. This shortcoming of power does not make it a ``robust'' piece of programming. In the case of power. In principle there is no limit to how deep recursion can go.'' This limit is a practical limit imposed by hardware limitations and details of the specific implementation of LISP you are using. but how deep this limit is.iu.
may vary in format In this output. from the top-level to the deepest call. each number at the beginning of the line represents the depth of the recursion.html10/19/2005 1:48:20 AM ..edu/~colallen/lp/node32.. along with the values returned. Your actual output . If you want to turn trace off. All calls to power are documented. then (untrace power) will turn off trace for that specific function. © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Enter the following: >(trace power) POWER >(power 3 4) 1> (POWER 3 4) 2> (POWER 3 3) 3> (POWER 3 2) 4> (POWER 3 1) 5> (POWER 3 0) <5 (POWER 1) <4 (POWER 3) <3 (POWER 9) <2 (POWER 27) <1 (POWER 81) 81 . This is a useful debugging tool to see whether your recursive function is doing what you think it should be doing.Using Trace To Watch Recursion Contents Next: Another Example Up: Recursive Definitions Previous: A Simple Example Using Trace To Watch Recursion LISP provides a nice way to watch the recursive process using trace. (untrace) with no arguments will turn off trace for all functions you may have traced. then the instruction to (trace power) may have to be repeated. If you redefine power and want to keep on watching the trace.iu.
stop if no elements first is a list add to number in rest else count in rest Try this function out on various examples (and don't forget to use trace to see what it is doing).. This one counts the number of elements of a list that are themselves lists: (defun num-sublists (lis) (cond ((null lis) 0) ((listp (first lis)) (1+ (num-sublists (rest lis)))) (t (num-sublists (rest lis))))) .iu. © Colin Allen & Maneesh Dhagat February 2005 http://mypage.Another Example Contents Next: Iteration Using Dotimes Up: Recursive Definitions Previous: Using Trace To Another Example Here's another recursive function. . and how you might alter the definition to handle this. . Also.. .html10/19/2005 1:48:21 AM .edu/~colallen/lp/node33.. think about what would happen if num-sublists is called with an atom as its argument..
Since result is initially 1. (1 * 3 * 3 * 3 * 3) = 81. The specification for dotimes is as follows: (dotimes (<counter> <limit> <result>) <body>) Counter is the name of a local variable that will be initially set to 0. the body will be evaluated four times before count eventually is equal to 4 and the value of result is returned.Iteration Using Dotimes Contents Next: Local Variables Using Up: Recursion and Iteration Previous: Another Example Iteration Using Dotimes Common LISP provides several means to do iteration. Since count does not equal y. If it is absent.edu/~colallen/lp/node34. so you are referred to Steele for information on loop. then when limit is reached. What happens when the interpreter evaluates (power-i 3 4)? First x and y are set to 3 and 4. Then count is intialized at 0. is multiplied by 3. limit must. dotimes returns nil. Concentrate on the dotimes. The correct performance of power-i clearly depends on the variable ``result'' having the right initial http://mypage.it may be any arbitrarily long sequence of LISP expressions.html (1 of 2)10/19/2005 1:48:23 AM .iu. do*. dotimes. except to note that it establishes a local variable called ``result'' whose initial value is 1. Result is optional. its new value is 3. Comprehensiveness is not our aim here. As you can see. as before. i. which is again not equal to y. so body is evaluated again. we will discuss two simple iteration macros. do. Here. The body of a dotimes statement is just like the body of a defun -. including loop. therefore.(setf result (* 3 result)) -.then incremented each time after body is evaluated. so the correct answer to (power 3 4) is returned. This time the existing value of result. 3. Here is power defined with dotimes: (defun power-i (x y) (let ((result 1)) (dotimes (count y result) (setf result (* x result))))) For the moment. If it is specified.e. ignore the let statement here. do. Then count is incremented to 1. evaluate to a positive integer. until limit is reached. the body -. and do*. so the new value of result is 9.is evaluated. dotimes and dolist. it is evaluated and returned by dotimes. and dolist.
First.Iteration Using Dotimes value. once power-i has returned its answer we no longer need result for anything. This approach is messy for two reasons. accessible only to power-i. The let statement is what enables us to create local variables. so neither of the aforementioned problems arises. If for example. A local variable cleanly disappears when power-i is done. result started at 0. The proper way to handle the result variable is to treat it as a local variable. this may cause the other function to malfunction. Second. Contents Next: Local Variables Using Up: Recursion and Iteration Previous: Another Example © Colin Allen & Maneesh Dhagat February 2005 http://mypage. four times. if result is a global variable it will keep on using up memory. If power-i changes that value.iu. would still be 0. and vice versa. We could define result as a global variable and set it to 1 before evaluating the dotimes. there is the possibility of another function using a global variable called result.edu/~colallen/lp/node34. However.html (2 of 2)10/19/2005 1:48:23 AM . 0 multiplied by 3.
So: (let* ((a 3) (b a))) http://mypage. the corresponding variable is set initially to nil. and together they define the code block within which the local variables are recognized. The left parenthesis before let matches the right parenthesis after the body.. so that. If any of the value expressions is omitted... however.. Let returns the value of the last expression evaluated in the body. for instance: (let ((a 3) (b a))) produces an error since a is still an unbound variable when the let statement tries to assign the value of b. (<vbln> <exprn>)) <body>) The first part of a let statement is a list of pairs of variable names and expressions providing initial values for those variables. Here is an example of a let statement evaluated directly by the interpreter: >(let ((x 3) (y (. as usual. Let..Local Variables Using Let Contents Next: Iteration Using Dolist Up: Recursion and Iteration Previous: Iteration Using Dotimes Local Variables Using Let The general form of a let statement is: (let ((<vbl1> <expr1>) ..edu/~colallen/lp/node35... is any sequence of LISP expressions... The body..html (1 of 2)10/19/2005 1:48:24 AM ..67 34))) (* x y)) 99 Sometimes when setting up a lot of local variables one would like the value of one variable to depend on another..iu.. Let has a sibling let* which does its variable assignments sequentially. does all its assignments in parallel.
Anytime you need a temporary storage handle for a value.Local Variables Using Let is fine.edu/~colallen/lp/node35. Let has applications beyond iterative processes.iu.html (2 of 2)10/19/2005 1:48:24 AM . © Colin Allen & Maneesh Dhagat February 2005 http://mypage. good LISP programming demands that you should think in terms of using a let statement rather than a global variable. and intializes both a and b to the value 3.
at which point result-form is evaluated and returned. Next-element is the name of a variable which is intially set to the first element of target-list (which must. next-element is set to the second element of target-list and so on until the end of target-list is reached. Thus. except that the iteration is controlled by the length of a list.Iteration Using Dolist Contents Next: When To Use Up: Recursion and Iteration Previous: Local Variables Using Iteration Using Dolist Dolist is very much like dotimes. in the if statement of the definition it is possible to omit the else clause entirely.iu.edu/~colallen/lp/node36.html10/19/2005 1:48:26 AM . rather than by the value of a count. Here is the general form for dolist: (dolist (<next-element> <target-list> <result>) <body>) In a dolist statment result and body work just as in dotimes. Notice that in the case where the next element of the list is not itself a list there is no need to do anything. The next time through. therefore be a list). © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Here is num-sublists done as an example: (defun num-sublists-i (lis) (let ((result 0)) (dolist (next lis result) (if (listp next) (setf result (1+ result)))))) The function num-sublists-i works because result is incremented only whenever the current element of the list indicated by next is itself a list.
.5 PI) 4 (/ 3 7)) (* 15 2)) Math-formula contains lists within lists within lists.5 PI) 4 (/ 3 7)) (* 15 2))) 3> (NUM-NUMS ((* (.html (1 of 3)10/19/2005 1:48:28 AM ..5 PI) 4 (/ 3 7)) (* 15 2))) 4> (NUM-NUMS (* (. . However.. >(num-nums math-formula) 1> (NUM-NUMS (+ 3 (* (. This typically arises when considering objects with a complex nested list structure.iu. count rest else it's list to count and add to num in rest Try this function out and watch it using trace. For example.edu/~colallen/lp/node37..5 pi) 4 (/ 3 7)) (* 15 2))) (+ 3 (* (.5 PI) 4 (/ 3 7))) http://mypage.5 PI) 4 (/ 3 7)) (* 15 2))) 2> (NUM-NUMS (3 (* (.. there are many problems for which recursion is natural and iteration is extremely difficult.. Here is a recursive function that will find out: (defun num-nums (mf) (cond ((null mf) 0) ((numberp (first mf)) (1+ (num-nums (rest mf)))) ((atom (first mf)) (num-nums (rest mf))) (t (+ (num-nums (first mf)) (num-nums (rest mf)))))) .When To Use Recursion/When To Use Iteration Contents Next: Tail Recursion Up: Recursion and Iteration Previous: Iteration Using Dolist When To Use Recursion/When To Use Iteration So far. empty list has none if first is number add to number in rest if it's any other atom ignore it. . the two examples of operations presented are just as easy to program recursively as iteratively. . Suppose we would like to know how many numbers are buried in the depths of this formula. consider this LISP-format mathematical expression: >(setf math-formula '(+ 3 (* (. . Notice that the depth of recursion fluctuates as sub-lists are processed.. ..
5 PI)) 7> (NUM-NUMS (5 PI)) 8> (NUM-NUMS (PI)) 9> (NUM-NUMS NIL) <9 (NUM-NUMS 0) <8 (NUM-NUMS 0) <7 (NUM-NUMS 1) <6 (NUM-NUMS 1) 6> (NUM-NUMS (4 (/ 3 7))) 7> (NUM-NUMS ((/ 3 7))) 8> (NUM-NUMS (/ 3 7)) 9> (NUM-NUMS (3 7)) 10> (NUM-NUMS (7)) 11> (NUM-NUMS NIL) <11 (NUM-NUMS 0) <10 (NUM-NUMS 1) <9 (NUM-NUMS 2) <8 (NUM-NUMS 2) 8> (NUM-NUMS NIL) <8 (NUM-NUMS 0) <7 (NUM-NUMS 2) <6 (NUM-NUMS 3) <5 (NUM-NUMS 4) <4 (NUM-NUMS 4) 4> (NUM-NUMS ((* 15 2))) 5> (NUM-NUMS (* 15 2)) 6> (NUM-NUMS (15 2)) 7> (NUM-NUMS (2)) 8> (NUM-NUMS NIL) <8 (NUM-NUMS 0) <7 (NUM-NUMS 1) <6 (NUM-NUMS 2) <5 (NUM-NUMS 2) 5> (NUM-NUMS NIL) <5 (NUM-NUMS 0) <4 (NUM-NUMS 2) <3 (NUM-NUMS 6) <2 (NUM-NUMS 7) <1 (NUM-NUMS 7) 7 It would be hard to define num-nums iteratively. (It is not impossible.5 PI) 4 (/ 3 7))) 6> (NUM-NUMS (. but requires you know how to use http://mypage.When To Use Recursion/When To Use Iteration 5> (NUM-NUMS ((.iu.html (2 of 3)10/19/2005 1:48:28 AM .edu/~colallen/lp/node37.
the choice is clear.When To Use Recursion/When To Use Iteration a stack to mimic the recursion.html (3 of 3)10/19/2005 1:48:28 AM . © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Here. tree representations of the moves in a game are best represented as a nested list. For example.edu/~colallen/lp/node37.) Many artificial intelligence tasks involve searching through nested structures. recursive function definitions are an essential tool. Searching the tree involves recursively tracking through the tree. and all but unmanageable iteratively. if speed is an issue. For this kind of application. and when use recursion? There are (at least) these three factors to consider: (1) Iterative functions are typically faster than their recursive counterparts.iu. So. When should you use iteration. (2) If the stack limit is too constraining then you will prefer iteration over recursion. then. you would normally use iteration. (3) Some procedures are very naturally programmed recursively.
iu.html (1 of 2)10/19/2005 1:48:30 AM . get rid of second . above... None of the above examples of recursive functions are tail recursive. This function has the property of being tail-recursive: (defun mymax (nums) (cond ((= (length nums) 1) (car nums)) ((> (car nums) (cadr nums)) (mymax (cons (car nums) (cddr nums)))) (t (mymax (cdr nums))))) . 81. To be tail-recursive. the answer ultimately returned by the top-level call to the function must be identical to the value returned by the very bottom level call.edu/~colallen/lp/node38. If you get to the stage of compiling your LISP code (a compiler takes code in a programming language and turns it into binary machine language to make it run faster) some compilers are smart enough to distinguish tail-recursive processes from those that are not.. first > second so . else dump first If you trace this function applied to a list of numbers you will see something like the following: >(MYMAX '(1 3 412 43 1 1 3412 53 43 43 54)) 1> (MYMAX (1 3 412 43 1 1 3412 53 43 43 54)) 2> (MYMAX (3 412 43 1 1 3412 53 43 43 54)) 3> (MYMAX (412 43 1 1 3412 53 43 43 54)) 4> (MYMAX (412 1 1 3412 53 43 43 54)) 5> (MYMAX (412 1 3412 53 43 43 54)) 6> (MYMAX (412 3412 53 43 43 54)) 7> (MYMAX (3412 53 43 43 54)) 8> (MYMAX (3412 43 43 54)) 9> (MYMAX (3412 43 54)) 10> (MYMAX (3412 54)) 11> (MYMAX (3412)) <11 (MYMAX 3412) http://mypage. In the trace output from power..Tail Recursion Contents Next: Timing Function Calls Up: Recursion and Iteration Previous: When To Use Tail Recursion Item (1) above is only a rough rule of thumb. termination . you can see that the ultimate answer.. is not the same as the deepest level returned value which was 1. finds the largest . so power is not a tail-recursive function.
This can greatly speed up the operation of recursive functions.edu/~colallen/lp/node38. © Colin Allen & Maneesh Dhagat February 2005 http://mypage. and cutting off processing as soon as the lowest level returns. a ``smart'' compiler is capable of recognizing tail recursion.html (2 of 2)10/19/2005 1:48:30 AM .iu. Mymax is a tailrecursive function.Tail Recursion <10 (MYMAX 3412) <9 (MYMAX 3412) <8 (MYMAX 3412) <7 (MYMAX 3412) <6 (MYMAX 3412) <5 (MYMAX 3412) <4 (MYMAX 3412) <3 (MYMAX 3412) <2 (MYMAX 3412) <1 (MYMAX 3412) 3412 Notice that the answer 3412 is carried all the way from the bottom to the top-level. When compiling LISP code.
edu/~colallen/lp/node39. Real time refers to the time it actually took the computer to return the answer to the screen.083 secs 1267650600228229401496703205376 To assess the relative speeds of these two functions..iu.200 secs run time : 0.200 secs run time : 0. the run time for the LISP function is unchanged.Timing Function Calls Contents Next: Exercises Up: Recursion and Iteration Previous: Tail Recursion Timing Function Calls The LISP interpreter provides a interesting feature for timing the evaluation of a function call.e.133 secs 1267650600228229401496703205376 >(time (power-i 2 100)) real time : 0. In this example. switch cpu time between different processes to give the appearance of running them simultaneously. Run time and real time can differ because computers running multitasking operating systems. but real time increases. such as UNIX(tm). power-i uses about 2/3 as much cpu time as power. If there are a lot of other processes running on the computer. For example. the amount of time required by the computer's central processing unit to perform the calculation) is the key figure. here's time applied to the recursive and iterative versions of power as evaluated by the interpreter: >(time (power 2 100)) real time : 0. your output will vary © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html10/19/2005 1:48:32 AM . Any expression can be timed using (time <exp>). there is no difference in real time between the two functions. run time (i. In this example. .
html (1 of 2)10/19/2005 1:48:33 AM . Write an iterative version of the above and call it REMOVE-I.edu/~colallen/lp/node40. Here are a some examples of how your function should behave: >(my-remove 'hello '(hello why dont you say hello)) (WHY DONT YOU SAY) >(my-remove '(oops my) '(1 2 (oops my) 4 5)) (1 2 4 5) 3. MY-REMOVE should use recursion. Write a function called MY-REMOVE which removes all occurrences of an element from a list. LISP provides a predefined function MEMBER which behaves as follows: >(member 3 '(1 2 3 4 5) ) (3 4 5) >(member 'hey '(whats going on here) ) NIL >(member 'key '(where did (i (put) the (key))) ) NIL Write a recursive function called MY-MEMBER which checks for an atom inside nested lists. Redefine power so that it can handle negative integer exponents (without using LISP's own expt function). 4. Here are examples: http://mypage. 2.iu.Exercises Contents Next: Programming Techniques Up: Recursion and Iteration Previous: Timing Function Calls Exercises 1.
(defun palindromep (lst) (equal lst (reverse lst)) ) So. The following is a definition of PALINDROMEP which checks if a list is a palindrome.edu/~colallen/lp/node40. A palindrome is something that reads the same backwards as forwards. A mathematical expression in LISP may look something like: (+ (* 1 2 pi) 3 (.html (2 of 2)10/19/2005 1:48:33 AM . © Colin Allen & Maneesh Dhagat February 2005 http://mypage. 6.5)) Write a function INFIX which given LISP-like mathematical expressions. returns the infixed version.iu.4 5)) This would be more readable (to most humans) in ``infix'' notation: ((1 * 2 * pi) + 3 + (4 . for example: >(palindromep '(1 2 3 4 5 4 3 2 1)) T >(palindromep '(a b b a)) T >(palindromep '(1 2 3)) NIL Write a recursive version of this function called R-PALINDROMEP without using the function reverse.Exercises >(my-member 3 '(1 2 3 4 5) ) T >(my-member 'hey '(whats going on here) ) NIL >(my-member 'key '(where did (i (put) the (key))) ) T 5.
Programming Techniques Contents Next: A Word about Up: LISP Primer Previous: Exercises Programming Techniques As has been mentioned before. Good programming style in Common LISP is no different from other versions of LISP.edu/~colallen/lp/node41. The beauty of programming in LISP is still largely due to its original definition. LISP has its origins in lambda calculus and recursive function theory. q q q q q q q q A Word about LISP Recursion on Simple Lists Recursion on Nested Lists and Expressions Recursion on Numbers Ensuring Proper Termination Abstraction Summary of Rules Exercises © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Almost all implementations of it have modified this definition in various ways.iu. The basic definition of LISP is found in McCarthy et al [1965].html10/19/2005 1:48:52 AM . In this chapter we will examine several techniques that have proved to be very useful in effectively programming in LISP.
LISP programs. LISP programs tend to be short and elegant. a different kind of thinking is required. were specified entirely as expressions. have extensions which allow LISP programs to be more statementoriented. The readers may be familiar with Pascal. At the heart of LISP is recursion (chapter 3).A Word about LISP Contents Next: Recursion on Simple Up: Programming Techniques Previous: Programming Techniques A Word about LISP LISP is a functional programming language. which are all classified as imperative programming languages. or FORTRAN. recursive structure. one must learn to think recursively. the programs consisting of a sequence of statements. C. But also. This means it is based on the use of expressions.edu/~colallen/lp/node42. These languages are statement-oriented. This is very different from statementoriented thinking required for languages such as Pascal. © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Current day implementations of LISP. as originally defined.iu.html10/19/2005 1:49:02 AM . Due to their regular. to be able to program effectively in LISP. however. C. or FORTRAN. A few simple rules presented in the next few sections will help the reader to think recursively and create better LISP programs.
Think of the broad possibility of operations one may want to perform on lists: counting the number of elements in a list. 3. their solutions all follow the same structure. these represent only a small number of possibilities.Recursion on Simple Lists Contents Next: Recursion on Nested Up: Programming Techniques Previous: A Word about Recursion on Simple Lists Lists are one of the basic data structures in LISP. check for the termination condition. RULE OF THUMB 1: When recurring on a list. RULE OF THUMB 2: If a function builds a list using ``cons. Also. Very often programmers need to manipulate lists. All of these problems are inherently recursive. do three things: 1.iu. replacing an element in a list.html (1 of 5)10/19/2005 1:49:08 AM . recur with the ``rest'' of the list. use the first element of the list.edu/~colallen/lp/node43. searching for an element in a list. 2. removing a particular element from a list.'' return () at the http://mypage.
'' which takes a list and an element. ``remove. checking if it is the element to be removed.Recursion on Simple Lists terminating line. We know that we can stop searching if we (1) have reached the end of the list without finding the element to be removed. at each recursive call the list will get shorter by one element. and returns the original list with the first occurrence of the element removed. Thus. Example 1: Write a function. (3) http://mypage.iu.edu/~colallen/lp/node43. since we are only interested in its first occurrence). Let's try to apply Rule of Thumb 1.html (2 of 5)10/19/2005 1:49:08 AM . We must stop when the list becomes (). or (2) have found the element to be removed (we can stop. (1) From the rule we know that at each step we want to recur with the ``rest'' of the list. (2) The second part states that we should try to use the first element of the list. We can use the predicate ``null'' to check for this condition. Before each recursive call we want to check if the first element of the list equals the given element. To solve this problem we will have to look at each of the elements of the given list one by one. We can use the predicate ``equal'' to test for equality.
Thus. the importance and length of the three components may differ. in the third part. In different examples. Thus.iu. Using Rule of Thumb 2. our function will return (). if the test for ``null'' returns true. Note that we are building a list using ``cons. When we recur with the ``rest'' of the list. The following solution clearly shows the three parts of Rule of Thumb 1 and also illustrates the use of Rule of Thumb 2: (defun remove (lst elt) (cond ((null lst) nil) ((equal (first lst) elt) (rest lst)) (t (cons (first lst) (remove (rest lst) elt))))) The following notation gives an idea of the execution of ``remove'': (remove '(a 1 c = (cons = (cons = (cons = (cons = '(a 1 2 c 7) 'c) 'a (remove '(1 c 2 c 7) 'c)) 'a (cons '1 (remove '(c 2 c 7) 'c))) 'a (cons '1 '(2 c 7))) 'a '(1 2 c 7)) 2 c 7) (remove '(a (1 q) 2) 'q) = (cons 'a (remove '((1 = (cons 'a (cons '(1 q) = (cons 'a (cons '(1 q) = (cons 'a (cons '(1 q) = (cons 'a (cons '(1 q) = (cons 'a '((1 q) 2)) = '(a (1 q) 2) q) 2) 'q)) (remove '(2) 'q))) (cons 2 (remove '() 'q)))) (cons 2 '()))) '(2))) Note.edu/~colallen/lp/node43.html (3 of 5)10/19/2005 1:49:08 AM .'' specifically a list of elements excluding the element to be removed. it is important to preserve the elements that do not match the given element. we should use ``cons'' to save these elements. In the following example the second part of the rule (using the first element of the list) comes into play only implicitly.Recursion on Simple Lists We must remember that the function ``remove'' returns the original list with the first occurrence of the given element removed. http://mypage. Rule of Thumb 1 provides a general framework within which to think about recursion. we know that in such a case we should return () at the terminating line.
when we reach the end of the list we return 0 (the length of a null list).html (4 of 5)10/19/2005 1:49:08 AM .'' which takes a list and returns a count of all the top level elements in the list. but.iu. (2) We only use the first element implicitly. The solution is: (defun length (lst) (cond ((null lst) 0) (t (+ 1 (length (rest lst)))))) We can identify the three components mentioned in Rule of Thumb 1: (1) We still use ``null'' to test for termination. the first element of the list is not forgotten. since now we want to return a count of top level elements. Although we do not explicitly use (first lst). The following notation gives an idea of the execution of ``length'': (length '(a (2 = (+ 1 = (+ 1 = (+ 1 = (+ 1 = (+ 1 = (+ 1 = 3 q) 64)) (length '((2 q) 64))) (+ 1 (length '(64)))) (+ 1 (+ 1 (length '())))) (+ 1 (+ 1 0))) (+ 1 1)) 2) http://mypage. ``length. by adding a one to the result of the recursive call. (3) We do recur with the ``rest'' of the given list. we account for its presence by adding a one to the value returned by the recursive call.edu/~colallen/lp/node43.Recursion on Simple Lists Example 2: Write a function. we keep a track of the top level elements.
iu.Recursion on Simple Lists Contents Next: Recursion on Nested Up: Programming Techniques Previous: A Word about © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node43.html (5 of 5)10/19/2005 1:49:08 AM .
3. deleting.iu. Such recursion is slightly more complicated than recursion on simple lists. Searching. recur with the ``first'' and the ``rest'' of the list. (5 g). For example. do three things: 1. a. RULE OF THUMB 3: When recurring on a nested list.html (1 of 5)10/19/2005 1:49:11 AM . or evaluating arbitrarily complex mathematical expressions are all naturally recursive problems on nested lists. A nested list consists of atoms and lists. check for the termination condition. 2. Example 3: http://mypage. but it again follows a common. given the list '(1 a (5 g) up). replacing atoms in a multi-level list. and up. But often we are interested in looking deeper than just the top-level. general structure.Recursion on Nested Lists and Expressions Contents Next: Recursion on Numbers Up: Programming Techniques Previous: Recursion on Simple Recursion on Nested Lists and Expressions So far we have worked only with simple lists. inserting. check if the first element of the list is an atom or a list. the latter may themselves be nested. These are lists for which the top-level elements are our only concern. the top-level elements are: 1.edu/~colallen/lp/node44.
If they match. the overall result is also true. (3) Lastly.html (2 of 5)10/19/2005 1:49:11 AM . if we discover that the first element is a list. we will return (). ``search. The above translates into the following simple piece of code: (defun search (lst elt) (cond ((null lst) nil) ((atom (first lst)) (if (equal (first lst) elt) 't (search (rest lst) elt))) (t (or (search (first lst) elt) (search (rest lst) elt))))) The following notation gives an idea of the execution of ``search'': (search '(a (1 c) 2 7) 'c) = (search '((1 c) 2 7) 'c) = (or (search '(1 c) 'c) (search '(2 7) 'c)) http://mypage. and it returns 't if it finds the atom within the nested list and returns nil otherwise.'' (2) At each step we will look at the first element of the list. if it is an atom we will check if it equals the given atom. We can use ``equal'' to test for equality. we can return 't immediately.iu.edu/~colallen/lp/node44.'' which takes a nested list and an atom. If the result of either of these searches is 't. We can use the predicate ``atom'' to check if the first element is an atom. let's take the steps recommended by Rule of Thumb 3: (1) We will move through the list one element at a time and if we reach the end without finding the given atom. the second within the ``rest'' of the original list. We can use the logical function ``or'' to get this effect. To check for termination we can use the predicate ``null. To write this function. we may need to perform two searches: the first within the nested list represented by the first element. else we go on with the search in the rest of the list.Recursion on Nested Lists and Expressions Write a function.
RULE OF THUMB 4: When evaluating an expression. (evaluate '(* (+ 4 6) 4) should http://mypage. 2. 3. Example 4: Write a function. identify operator. Thus. do three things: 1.Recursion on Nested Lists and Expressions = (or (search '(c) 'c) (search '(2 7) 'c)) = (or 't (search '(2 7) 'c)) = 't Note that ``or'' only needs to evaluate upto the first non-nil argument to return true. and * may be used as operators and each operator can have only two operands. check for the termination condition. Only +.'' which takes a prefix expression represented as a nested list and returns the numerical value represented by the expression. Similarly.edu/~colallen/lp/node44. ``and'' only needs to evaluate upto the first nil argument to return nil. -. ``evaluate.iu. apply operator to recursive calls on the operands.html (3 of 5)10/19/2005 1:49:11 AM . Another interesting application of recursion is the evaluation of mathematical or logical expressions.
edu/~colallen/lp/node44.(+ -1 2) 3))) http://mypage. The argument of ``evaluate'' represents an expression. The above translates into the following simple piece of code: (defun evaluate (expr) (cond ((numberp expr) expr) ((equal (first expr) '+) (+ (evaluate (second expr)) (evaluate (third expr)))) ((equal (first expr) '-) (.(+ -1 2) 3))) = (* (+ (evaluate 6) (evaluate 3)) (evaluate '(.iu. we will need to further evaluate the operands. The following notation gives an idea of the execution of ``evaluate'': (evaluate '(* (+ 6 3) (. Let us again try to identify the three elements of the previous Rule of Thumb: (1) Note that we are no longer working with a list of elements. we can stop.Recursion on Nested Lists and Expressions return 40. If the argument is a number. the first operand sub-expression.(+ -1 2) 3))) = (* (+ 6 3) (evaluate '(. For each operator we will need to apply a different function.(+ -1 2) 3)) = (* (evaluate '(+ 6 3)) (evaluate '(.(evaluate (second expr)) (evaluate (third expr)))) (t (* (evaluate (second expr)) (evaluate (third expr)))))) Since there are only three possible operators. If this argument is a list we know that it will have three parts: an operator. we can use the default case for *. the second operand sub-expression.html (4 of 5)10/19/2005 1:49:11 AM .(+ -1 2) 3))) = (* (+ 6 (evaluate 3)) (evaluate '(. In this case. We can use the predicate ``numberp'' to test for a numerical value. (3) For each possible operator we will recursively call evaluate on the first and second operands. (2) We can identify the first element of the argument list as the operator.
(+ -1 2) 3))) = (* 9 (.(+ -1 2) (evaluate 3))) = (* 9 (.(evaluate '(+ -1 2)) (evaluate 3))) = (* 9 (.1 3)) = (* 9 -2) = -18 Contents Next: Recursion on Numbers Up: Programming Techniques Previous: Recursion on Simple © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node44.Recursion on Nested Lists and Expressions = (* 9 (evaluate '(.iu.1 (evaluate 3))) = (* 9 (.(+ -1 (evaluate 2)) (evaluate 3))) = (* 9 (.(+ (evaluate -1) (evaluate 2)) (evaluate 3))) = (* 9 (.html (5 of 5)10/19/2005 1:49:11 AM .
``product-of-list. In both cases one must be careful in choosing which value to return at the terminating line. In the case of length.html (1 of 5)10/19/2005 1:49:13 AM . It takes an arbitrarily long list of elements and returns a count of its top-level elements. RULE OF THUMB 5: When building a number value using +.Recursion on Numbers Contents Next: Ensuring Proper Termination Up: Programming Techniques Previous: Recursion on Nested Recursion on Numbers There are some functions which recur on a list of elements.iu.edu/~colallen/lp/node45. Example 5: Write a function. return 1 at the terminating line.'' which takes a list of numbers and returns their product. at each level we add a one. return 0 at the terminating line. Write a similar function. When building a number value using *. ``sum-of-list. One can also imagine a function which builds a number with consecutive multiplications. The function ``length'' defined earlier is such a function. http://mypage.'' which takes a list of numbers and returns their sum. we are building a number by additions. but which return a number.
second we will use the first element of the list in the addition (or multiplication). RULE OF THUMB 6: When recurring on a number. recur with a changed form of the number. lastly the number will be added (or multipled) to the recursive call on the ``rest'' of the list. check for the termination condition. According to Rule of Thumb 5. The structure of recursion on numbers is very similar to that on simple lists. although we are building a number. we must remember that at the terminating line we must return 0 for addition and 1 for multiplication.html (2 of 5)10/19/2005 1:49:13 AM . It is also possible to recur on a number. http://mypage. we need to do three things: first we will check for the end of the list. writing these functions should be simple.edu/~colallen/lp/node45.iu. do three things: 1. 3.Recursion on Numbers Using the ideas presented in previous sections. we are still recurring on a list. Again. 2. use the number in some form. The following are the proposed solutions: (defun sum-of-list (lst) (cond ((null lst) 0) (t (+ (first lst) (sum-of-list (rest lst)))))) (defun product-of-list (lst) (cond ((null lst) 1) (t (* (first lst) (product-of-list (rest lst)))))) In the above examples.
on n decremented by one.iu. n. n.html (3 of 5)10/19/2005 1:49:13 AM . it is very often represented mathematically as the following recurrence relation: factorial(n) = {n * factorial(n-1) if n>0} {1 if n=0} This translates easily into the following LISP function definition: (defun factorial (n) (cond ((= n 0) 1) (t (* n (factorial (.Recursion on Numbers Example 6: The factorial of a non-negative integer.. is n * (n-1) * (n-2) * . in the multiplication. The above problem is naturally recursive.n 1)))))) Let us try to identify the three element of Rule of Thumb 6: (1) We check for termination by testing if n has been reduced to 0. Also. (3) We do recur on a changed form of the number. i. In fact. Implement the factorial function in LISP. * 3 * 2 * 1.e. (2) We use the number. The following notation gives an idea of the execution of ``factorial'': http://mypage..edu/~colallen/lp/node45. the factorial of 0 is 1.
this represents our use of n.'' which takes two positive non-zero numbers. (3) We will recur with the value of n changed. specifically.Recursion on Numbers (factorial 4) = (* 4 = (* 4 = (* 4 = (* 4 = (* 4 = (* 4 = (* 4 = (* 4 = 24 (factorial 3)) (* 3 (factorial 2))) (* 3 (* 2 (factorial 1)))) (* 3 (* 2 (* 1 (factorial 0))))) (* 3 (* 2 (* 1 1)))) (* 3 (* 2 1))) (* 3 2)) 6) Example 7: Write a function called ``remainder. Let us proceed in the steps suggested by Rule of Thumb 6: (1) We know that we can stop when n < m.n m) m)))) The following notation gives an idea of the execution of ``remainder'': http://mypage. we will recur with n-m and m.html (4 of 5)10/19/2005 1:49:13 AM . at this point n will be the value of the remainder. These steps translate into the following function definition: (defun remainder (n m) (cond ((< n m) n) (t (remainder (. n and m. and returns the remainder when n is divided by m.iu. This will be our termination condition and we will return the value of n.edu/~colallen/lp/node45. (2) At each level of recursion we will subtract m from n. Our strategy will be to repeatedly subtract m from n till n is less than m.
iu.edu/~colallen/lp/node45.Recursion on Numbers (remainder 30 7) = (remainder = (remainder = (remainder = (remainder = 2 23 7) 16 7) 9 7) 2 7) Contents Next: Ensuring Proper Termination Up: Programming Techniques Previous: Recursion on Nested © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html (5 of 5)10/19/2005 1:49:13 AM .
is often more difficult to discover. ``dotimes'' iterates a specified number of times.iu. or an improper recursion.html (1 of 4)10/19/2005 1:49:15 AM . it may be that the programmer is using the general ``do'' construct and has specified a test for termination that will never occur. In the first case. This problem can be avoided by using the more specific constructs ``dotimes'' or ``dolist'' (chapter 3).edu/~colallen/lp/node46. This could happen in two different ways: an infinite ``do'' loop. however.Ensuring Proper Termination Contents Next: Abstraction Up: Programming Techniques Previous: Recursion on Numbers Ensuring Proper Termination Often it happens that the LISP programmer unknowingly implements an infinite loop. Improper recursion. and ``dolist'' iterates once for each element in a given list. Example 8: The following definition wrongly implements the function to determine the length of a list: (defun length (lst) (cond ((null lst) 0) (t (+ 1 (length lst))))) The following notation illustrates why the above function does not terminate: http://mypage. These constructs have a built-in test for termination.
.. = .'' takes two positive. (2) make sure that your test for termination looks at the arguments that change in the recursive call. Such simple mistakes are very common. ``exp.html (2 of 4)10/19/2005 1:49:15 AM . non-zero integers.. Compare this definition of ``length'' with the one given in section 4.Ensuring Proper Termination (length '(a b c)) = (+ 1 (length '(a b c))) = (+ 1 (+ 1 (length '(a b c)))) = (+ 1 (+ 1 (+ 1 (length '(a b c))))) = (+ 1 (+ 1 (+ 1 (+ 1 (length '(a b c)))))) = (+ 1 (+ 1 (+ 1 (+ 1 (+ 1 (length '(a b c))))))) = . and http://mypage. Example 9: A function.iu.. and their frequency increases with longer and more complicated programs. x and y. RULE OF THUMB 7: To ensure proper termination do two things: (1) make sure that you are changing at least one argument in your recursive call.2.edu/~colallen/lp/node46. The list is passed-in unmodified in the recursive call.
iu. the above definition is correct and will terminate properly according to Rule of Thumb 7. we are using an argument that we change in the recursive call. Will the following recursive definition for ``exp'' terminate properly? (defun exp (x y) (cond ((= y 0) 1) (t (* x (exp x (.edu/~colallen/lp/node46.y 1)))))) Yes. (= y 0). which is decremented by one.html (3 of 4)10/19/2005 1:49:15 AM . namely y. namely y. use ``null'' in the test for termination. RULE OF THUMB 8: Two simple cases may occur when changing an argument in a recursive call: (1) if you are using ``rest'' to change an argument which is a list. We fulfill both requirements of the rule: (1) We are changing at least one argument in the recursive call. http://mypage.Ensuring Proper Termination raises x to the y power. (2) In our test for termination.
iu.Ensuring Proper Termination (2) if you are decreasing an argument which is a number.edu/~colallen/lp/node46.html (4 of 4)10/19/2005 1:49:15 AM . Contents Next: Abstraction Up: Programming Techniques Previous: Recursion on Numbers © Colin Allen & Maneesh Dhagat February 2005 http://mypage. compare it with 0 in the test for termination.
Thus. When all of the details of the program are considered at once. http://mypage. The latter is explored in this section.Abstraction Contents Next: Summary of Rules Up: Programming Techniques Previous: Ensuring Proper Termination Abstraction As a program becomes larger. they may easily exceed the intellectual grasp of one person.'' which takes a list of numbers and returns the same list with each element replaced with its cube. it becomes increasingly difficult to understand. RULE OF THUMB 9: Use ``let'' to reduce the number of function calls. Hiding fragments of the program increases clarity and often also results in shorter programs. There are two areas in which abstraction may be used: one may hide the details of the data one is working with by using abstract data structures and associated routines (chapter 5). Example 10: Write a function called ``cube-list. or one may hide fragments of the program to improve clarity.iu. it is useful to abstract away or ``hide'' unnecessary details. To increase the readability of the program.html (1 of 6)10/19/2005 1:49:18 AM . (cube-list '(5 3 -15)) should return (125 9 -3375).edu/~colallen/lp/node47.
we can reduce this to only one use of ``first'' for each element. with the techniques presented above. This may be done as follows: (defun cube-list (lst) (cond ((null lst) nil) (t (let ((elt (first lst))) (cons (* elt elt elt) (cube-list (rest lst))))))) RULE OF THUMB 10: Encapsulate program fragments into new functions to improve clarity.'' which takes a number and returns its http://mypage.Abstraction By now. the reader should be able to see that the following is a possible solution: (defun cube-list (lst) (cond ((null lst) nil) (t (cons (* (first lst) (first lst) (first lst)) (cube-list (rest lst)))))) But note that to compute the cube of each element we must extract it three times from the list using ``first.iu.html (2 of 6)10/19/2005 1:49:18 AM .edu/~colallen/lp/node47. Example 11: Write a function called ``cube.'' Using Rule of Thumb 9.
Abstraction
cube. Use ``cube'' to rewrite ``cube-list.''
``cube'' is defined simply as follows: (defun cube (elt) (* elt elt elt)) Now we can use ``cube'' to rewrite ``cube-list'': (defun cube-list (lst) (cond ((null lst) nil) (t (cons (cube (first lst)) (cube-list (rest lst)))))) These last two definitions are much easier to read and understand, and they do not waste any function calls. Furthermore, cube is a useful tool that may be used in other function definitions.
RULE OF THUMB 11:
Encapsulate repeated program fragments into new
functions to reduce program size.
Example 12:
Suppose a list of two numbers represents a point in euclidean space.
Write a function called ``get-side,'' which takes three points, a, b, and
http://mypage.iu.edu/~colallen/lp/node47.html (3 of 6)10/19/2005 1:49:18 AM
Abstraction
c, and a key, k. The three points represent the vertices of a triangle.
The function returns a value as follows:
if k = 1, returns length of side a-b;
if k = 2, returns length of side b-c;
if k = 3, returns length of side c-a;
else, returns 0.
One possible solution is the following: (defun get-side (a b c k) (cond ((= k 1) (sqrt (+ (exp ((exp (((= k 2) (sqrt (+ (exp ((exp (((= k 3) (sqrt (+ (exp ((exp ((t 0)))
(first a) (first b)) 2) (second a) (second b)) 2)))) (first b) (first c)) 2) (second b) (second c)) 2)))) (first c) (first a)) 2) (second c) (second a)) 2))))
Note that we are performing almost the same computation in the first three cases of the ``cond'' clause; specifically, it is to calculate the distance between two points.
Example 13:
http://mypage.iu.edu/~colallen/lp/node47.html (4 of 6)10/19/2005 1:49:18 AM
Abstraction
Write a function called ``distance,'' which takes two points (represented
as two-number lists), and returns the euclidean distance between them.
Use ``distance'' to rewrite ``get-side.''
The function ``distance'' can be implemented simply as follows: (defun distance (pt1 pt2) (sqrt (+ (exp (- (first pt1) (first pt2)) 2) (exp (- (second pt1) (second pt2)) 2)))) Now we can rewrite ``get-side'' as follows: (defun get-side (a b c k) (cond ((= k 1) (distance a b)) ((= k 2) (distance b c)) ((= k 3) (distance c a)) (t 0))) Thus, using Rule of Thumb 11, we have reduced the size of the program significantly, making it easier to understand. The concept of abstraction is not unique to LISP. It is also used in other high-level programming languages such as C, Pascal, or FORTRAN.
Contents Next: Summary of Rules Up: Programming Techniques Previous: Ensuring Proper Termination
© Colin Allen & Maneesh Dhagat
http://mypage.iu.edu/~colallen/lp/node47.html (5 of 6)10/19/2005 1:49:18 AM
Abstraction
February 2005
http://mypage.iu.edu/~colallen/lp/node47.html (6 of 6)10/19/2005 1:49:18 AM
check for the termination condition. If a function builds a list using ``cons. do three things: a. 5. 3.iu. do three things: a. 4.html (1 of 3)10/19/2005 1:49:19 AM . When evaluating an expression. return 1 at the terminating line. apply operator to recursive calls on the operands. use the first element of the list. check if the first element of the list is an atom or a list. c. c. c. check for the termination condition.'' return () at the terminating line. return 0 at the terminating line. 2. do three things: a. recur with the ``first'' and the ``rest'' of the list. When recurring on a nested list. b. b. When building a number value using +. b. When building a number value using *. check for the termination condition. When recurring on a list. recur with the ``rest'' of the list.Summary of Rules Contents Next: Exercises Up: Programming Techniques Previous: Abstraction Summary of Rules 1. http://mypage.edu/~colallen/lp/node48. identify operator.
10. recur with a changed form of the number.html (2 of 3)10/19/2005 1:49:19 AM . b. b. check for the termination condition. c. use ``null'' in the test for termination. To ensure proper termination do two things: a. 11. 8. Use ``let'' to reduce the number of function calls.iu. use the number in some form. Contents Next: Exercises Up: Programming Techniques Previous: Abstraction http://mypage. 7. compare it with 0 in the test for termination. make sure that your test for termination looks at the arguments that change in the recursive call. if you are using ``rest'' to change an argument which is a list. When recurring on a number. Encapsulate repeated program fragments into new functions to reduce program size. Encapsulate program fragments into new functions to improve clarity.edu/~colallen/lp/node48. make sure that you are changing at least one argument in your recursive call.Summary of Rules 6. b. if you are decreasing an argument which is a number. Two simple cases may occur when changing an argument in a recursive call: a. do three things: a. 9.
html (3 of 3)10/19/2005 1:49:19 AM .edu/~colallen/lp/node48.iu.Summary of Rules © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
'' which takes a list and two elements as arguments. which takes a list and an element as arguments. 3. 2. Write a function which counts all of the atoms in a nested list. http://mypage.'' which takes a nested list and two atoms as arguments.iu. and returns the original list with all instances of the first element replaced by the second element. Write a function called ``replace. A new mathematical. The Fibonacci series is defined as follows: fib(n) = {fib(n-1) + fib(n-2) if n>1 } {1 if n=0 or n=1} Implement a recursive function to calculate the nth fibonacci number. 5.Exercises Contents Next: Simple Data Structures Up: Programming Techniques Previous: Summary of Rules Exercises 1.edu/~colallen/lp/node49. 6. binary operator \$ is defined as follows: x \$ y = x2 + y where x. Extend the definition of ``evaluate'' presented earlier to include the operators \$ and / (normal division). y are integers. 7.html (1 of 2)10/19/2005 1:49:21 AM . and returns the original list in which the second atom has been inserted to the right of all occurrences of the first atom (if the first atom occurs in the list at all). 4. Write a function called ``insert. and returns the original list with all occurrences of the element removed. Write a function called ``b-remove'' (for better remove).
Be careful to (defun mystery (n) (cond ((= n 0) 0) (t (mystery (. For example. Will the following piece of code always terminate? consider all possible cases. It adds the corresponding members of each list and then returns the product of the resulting numbers. since (1+2)*(2+2)*(3+2)=60.Exercises Write a function called ``merge. (merge '(1 2 3) '(2 2 2)) should return 60.iu. 8.'' which takes two number-lists of equal length.html (2 of 2)10/19/2005 1:49:21 AM .edu/~colallen/lp/node49.n 1))))) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
Arrays.Simple Data Structures in LISP Contents Next: Association Lists Up: LISP Primer Previous: Exercises Simple Data Structures in LISP Many applications of LISP involve storing a variety of values associated with a symbolic name. Defstruct provides a way to create customized data structures. and Strings r Arrays and Vectors r Strings Defstruct Exercises. Association lists and property lists provide two ways of doing this. q q q q q Association Lists Property Lists Arrays. unique to LISP. © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node50. vectors and strings are also used for data storage and manipulation.iu.html10/19/2005 1:49:43 AM . Vectors. Their use is similar to programming languages other than LISP.
iu. Use the interpreter to enter this example of an association list: >(setf person1 '((first-name john) (last-name smith) (age 23) (children jane jim))) ((FIRST-NAME JOHN) (LAST-NAME SMITH) (AGE 23) (CHILDREN JANE JIM)) LISP provides a function. Following each key.<expressions>). It does not matter to assoc what order the keys appear in the association list or how many expressions are associated with each key. For example: >(assoc 'age person1) (AGE 23) >(assoc 'children person1) (CHILDREN JANE JIM) Notice that assoc returns the entire key-expression sublist.<expressions>) (<key2> .. you can put any sequence of LISP expressions. For example.Association Lists Contents Next: Property Lists Up: Simple Data Structures Previous: Simple Data Structures Association Lists An association list is any list of the following form: ((<key1> .... Setf can be used to change particular values.) The keys should be atoms.edu/~colallen/lp/node51...html (1 of 2)10/19/2005 1:49:52 AM . to retrieve information easily from association lists given a retrieval key.. here is a function that can be used on a http://mypage. assoc.
then see that it works: >(make-older person1) 24 >(assoc 'age person1) (AGE 24) Assoc will return nil if the key is not found.html (2 of 2)10/19/2005 1:49:52 AM .edu/~colallen/lp/node51. (defun make-older (person) (setf (second (assoc 'age person)) (1+ (second (assoc 'age person))))) Have your LISP interpreter evaluate this definition.iu.Association Lists birthday to update a person's age automatically. >(assoc 'sex person1) NIL But it is very easy to add new key-expression sublists. again using setf. >(setf person1 (cons '(sex male) person1)) ((SEX MALE) (FIRST-NAME JOHN) (LAST-NAME SMITH) (AGE 24) (CHILDREN JANE JIM)) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
>(get 'mary 'age) NIL >(setf (get 'mary 'age) 45) 45 >(get 'mary 'age) 45 As this example shows.html (1 of 2)10/19/2005 1:49:56 AM . >(setf (get 'mary 'job) 'banker) BANKER >(setf (get 'mary 'sex) 'female) FEMALE >(setf (get 'mary 'children) '(bonnie bob)) (BONNIE BOB) http://mypage. the value to be returned by a get expression is set using setf.Property Lists Contents Next: ArraysVectors. and Up: Simple Data Structures Previous: Association Lists Property Lists An alternative way to attach data to symbols is to use Common LISP's property list feature. Additional properties can be added in the same way.edu/~colallen/lp/node52. the LISP interpreter maintains a list of properties which can be accessed with the function get. For each symbol. Get expects to be given a symbol and a key. otherwise get returns nil.iu. If a value has been set for that key. The example here assigns the value 45 as the value to be returned when you type (get 'mary 'age). (This is another place where setf works but setq will not.) The way to think of setf's behavior here is that you tell it exactly what you will type and what should be returned. it is returned.
you need to see all the properties a symbol has. and in some ways is more flexible than assoc. For many applications.Property Lists If. Customized list structures will not be covered here because they are highly dependent on the specific application. you can do so: >(symbol-plist 'mary) (SEX FEMALE JOB BANKER AGE 45 CHILDREN (BONNIE BOB)) Get is a convenient way to manage related data. it is necessary to build more sophisticated data structures.edu/~colallen/lp/node52. © Colin Allen & Maneesh Dhagat February 2005 http://mypage. however. as the purpose of this book is to bring you to a point where you can easily understand other presentations of advanced LISP topics.html (2 of 2)10/19/2005 1:49:56 AM . and use of the Common Lisp Object System (CLOS). for some reason. CLOS will not be covered here. either. and strings will be introduced in the rest of this chapter. vectors. Options for doing this include customized nested list structures. Arrays. arrays.iu.
and Strings Contents Next: Arrays and Vectors Up: Simple Data Structures Previous: Property Lists Arrays.html10/19/2005 1:49:57 AM .iu. Vectors. Vectors.edu/~colallen/lp/node53. and Strings q q Arrays and Vectors Strings © Colin Allen & Maneesh Dhagat February 2005 http://mypage.Arrays.
The simplest case is an array of one dimension. These examples illustrate: >(aref my-vector 2) NIL >(setf (aref my-vector 0) t) T >my-vector #(T NIL NIL) Indexing of arrays starts with 0. the argument to make-array specified that the array should have one dimension of three elements. (Just like indexing of lists using nth. and Previous: ArraysVectors.iu. also called a vector. Arrays are created using the make-array function.html (1 of 2)10/19/2005 1:49:59 AM .edu/~colallen/lp/node54.) Here's an example of a twodimensional array and some assignments. Most often one wants to bind this array to a symbol. To make an array it is necessary to specify the size and dimensions. Here's an example: >(setf my-vector (make-array '(3))) #(NIL NIL NIL) In this case. The array that was returned has three elements.) These elements can be accessed and changed using aref. all of them initially set to nil. and Arrays and Vectors An array is a special type of data object in LISP. >(setf my-array (make-array '(2 3))) #2A((NIL NIL NIL) (NIL NIL NIL)) >(aref my-array 0 1) NIL http://mypage. Make-array returns an array. (The actual printed representation of the array may vary between different LISP implementations.Arrays and Vectors Contents Next: Strings Up: ArraysVectors.
In general.html (2 of 2)10/19/2005 1:49:59 AM . © Colin Allen & Maneesh Dhagat February 2005 http://mypage. as is the use of other keywords not introduced here.edu/~colallen/lp/node54. The use of :initial-contents is entirely optional with make-array.iu. however. Here is an example to illustrate the use of :initial-contents. Make array has a number of additional features we will not cover here. Consider the structure represented in this list: (a (b c) (d e f (g h))) No array can concisely reproduce this structure.Arrays and Vectors >(setf (aref my-array 0 1) 'hi) HI >(setf (aref my-array 1 0) 'bye) BYE >my-array #2A((NIL HI NIL) (BYE NIL NIL)) From this example you should be able to work out the indexing scheme. Programmers like to use arrays because they give uniformly fast access to all their elements. arrays are less flexible for representing structure than lists. since it must have a uniform number of elements for each of its dimensions. one that is particularly useful is the :initial-contents keyword. >(make-array '(2 3 4) :initial-contents '(((a b c d) (e f g h) (i j k l)) ((m n o p) (q r s t) (u v w x)))) #3A(((A B C D) (E F G H) (I J K L)) ((M N O P) (Q R S T) (U V W X))) Initial contents are specified with a list of elements having the required sublist structure to match the array. However.
otherwise unmanageable punctuation marks.Strings Contents Next: Defstruct Up: ArraysVectors. A string is completely opaque to the interpreter and may contain punctuation marks and even new lines: >"This is a larger piece of text. Technically strings are arrays. It contains a few. It can even have blank lines: ^Like these!" Strings can also be included as elements of lists. and Previous: Arrays and Vectors Strings A string in LISP is represented by characters surrounded by double quotes: ". but it is probably best (at first) to ignore this fact and treat them as a separate data type. It can even have blank lines: ^Like these!" "This is a larger piece of text. It contains a few.html (1 of 2)10/19/2005 1:50:00 AM .iu. They are also used by Common LISP to manage input and output. otherwise unmanageable punctuation marks.edu/~colallen/lp/node55. For example: >(cons "this" '(here)) http://mypage. Strings are very useful for manipulating chunks of text. Typing a string directly to the interpreter simply causes the interpreter to return the string: >"This is a string" "This is a string" Notice that the string may contain spaces. and that the distinction between upper and lowercase letters is preserved.
iu.edu/~colallen/lp/node55.Strings ("this" HERE) Strings are very useful for giving nicely formatted responses to user commands. © Colin Allen & Maneesh Dhagat February 2005 http://mypage. This will be explored in the next chapter.html (2 of 2)10/19/2005 1:50:00 AM .
In this example the function is called make-employee. As with the other data types before. and ``age''. Each slot is provided an automatic access function.Defstruct Contents Next: Exercises. and all its slots are initially given the value nil. Up: Simple Data Structures Previous: Strings Defstruct Defstruct allows you to create your own data structures and automatically produces functions for accessing the data. Structures have names and ``slots.iu. and in general the name of the instance constructor function is makedefstructname. Defstruct creates a generic type of which particular ``instances'' can be made. are the slots. etc.html (1 of 3)10/19/2005 1:50:02 AM .edu/~colallen/lp/node56. by joining the structure name with the slot name: >(employee-age employee1) http://mypage. Defstruct automatically generates a function to make instances of the named structure.'' The slots are used for storing specific values.) In this case. Here is an example using defstruct to establish a structure type: >(defstruct employee age first-name last-name sex children) EMPLOYEE In this example ``employee'' is the name of the structure. employee1 is an instance of the type employee. it is useful to associate particular instances with a symbol for easy access: >(setf employee1 (make-employee)) #S(EMPLOYEE AGE NIL FIRST-NAME NIL LAST-NAME NIL SEX NIL CHILDREN NIL) (Different implementations of LISP will display structures in different ways.
and following it with the value for that slot: >(setf employee2 (make-employee :age 34 :last-name 'farquharson :first-name 'alice :sex 'female)) #S(EMPLOYEE AGE 34 FIRST-NAME ALICE LAST-NAME FARQUHARSON SEX FEMALE CHILDREN NIL) >(employee-first-name employee2) ALICE As this example shows. unless explicitly overridden. These three examples of instances illustrate the use of defaults: http://mypage. simply by preceding the slot name with a colon.that is. Defstruct also allows you to specify default values for given slots. Neither is it necessary to specify slot values in the same order they are specified in the original defstruct.edu/~colallen/lp/node56. it is not necessary to give values to all the slots when the make function is called.Defstruct NIL >(employee-sex employee1) NIL Slot values can be assigned using setf: >(setf (employee-age employee1) 56) 56 >(employee-age employee1) 56 It is also possible to assign values to the slots of a particular instance at the time the instance is made.html (2 of 3)10/19/2005 1:50:02 AM .iu. Here is an example: >(defstruct trekkie (sex 'male) (intelligence 'high) age) TREKKIE The values enclosed in parentheses with a slot name are the default values for that slot -. the values that these slots will have for created instance.
you will have no trouble understanding the description of these features in Steele's Common Lisp the language. Contents Next: Exercises.iu. however. Up: Simple Data Structures Previous: Strings © Colin Allen & Maneesh Dhagat February 2005 http://mypage.Defstruct >(setf t1 (make-trekkie)) #S(TREKKIE SEX MALE INTELLIGENCE HIGH AGE NIL) >(setf t2 (make-trekkie :age 35)) #S(TREKKIE SEX MALE INTELLIGENCE HIGH AGE 35) >(setf t3 (make-trekkie :age 28 :sex 'female)) #S(TREKKIE SEX FEMALE INTELLIGENCE HIGH AGE 28) Each instance of a structure has a type which can be tested with the predicate typep.edu/~colallen/lp/node56.html (3 of 3)10/19/2005 1:50:02 AM . including the ability to create structures which incorporate other structures. or with the particular predicate automatically set up by defstruct. If you understand the basics laid out here. By default. the type of an instance is determined by the structure name: >(typep t1 'employee) NIL >(typep t1 'trekkie) T >(trekkie-p t1) T >(employee-p t3) NIL There are several advanced features of defstruct.
html10/19/2005 1:50:15 AM .Input and Output Contents Next: Basic Printing Up: LISP Primer Previous: Exercises.iu. More sophisticated output is available using format. Input and output using system files is achieved using the same functions and associating a file with an input or output ``stream''. Input and Output Terminal input and output is controlled with variants of print and read.edu/~colallen/lp/node58. q q q q q Basic Printing Nicer Output Using Format Reading Input and Output to Files Converting Strings to Lists © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
Basic Printing Contents Next: Nicer Output Using Up: Input and Output Previous: Input and Output Basic Printing Frill-free printing in LISP is achieved with print. which produces a newline. and princ involve a single argument.. Terpri. they return values.iu. printed . returned . Here are examples using print: >(print 'this) THIS THIS >(print (+ 1 2)) 3 3 >(+ (print 1) (print 2)) 1 2 3 . The simplest uses of print. the value returned is always the result of evaluating the first argument.. princ.. prin1. In addition to causing output.. All these are functions.. returns sum . Prin1 is just like print except that it does not do a new line before printing. princ and terpri..edu/~colallen/lp/node59. value returned Print always precedes its output with a newline. Terpri always returns nil. With print. can be called with no arguments.. and prin1.html (1 of 3)10/19/2005 1:50:48 AM . prin1. first print . second print . >(+ (prin1 1) (prin1 2)) 12 3 http://mypage. printed .
.. One way to help you see what is going on is to insert print statements into the definition.edu/~colallen/lp/node59. printed "this string" .. (defun my-print (x) (terpri) (prin1 x)) Princ and prin1 are the same except in the way they print strings. no quotes can be more readable "this string" .. If for example you want to see what is being listed if the test is true. suppose you have a function defined as follows: (defun foo (x y) (if (eq x y) (list (second x) (first y)) (list y (rest x)))) You try the function out and get this: >(foo '(a s d f) '(a s d f)) ((A S D F) (S D F)) But you expected to get (S A) since you expected to get the list of the second of x with the first of y. For example. Princ does not print the quote marks around a string: >(prin1 "this string") "this string" . the following happens: http://mypage.Basic Printing Print is thus equivalent to terpri followed by prin1. returned >(princ "this string") this string . You would like to know why foo returned this.iu. string returned The print family of functions is useful as a debugging tool. This function will behave just like print when passed a single argument. you can modify the definition like this: (defun foo (x y) (if (eq x y) (list (print (second x)) (print (first y))) (list y (rest x)))) Now when you try the same call. they can be inserted into a previously defined function to reveal what is going on. Since they return the values of their arguments.html (2 of 3)10/19/2005 1:50:48 AM .
iu.html (3 of 3)10/19/2005 1:50:48 AM .edu/~colallen/lp/node59. Now you modify the definition of foo again: (defun foo (x y) (if (equal x y) (list (print (second x)) (print (first y))) (list y (rest x)))) And try it out: >(foo '(a s d f) '(a s d f)) S A (S A) This time you see the effects of the prints. Contents Next: Nicer Output Using Up: Input and Output Previous: Input and Output © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Thus print helps you to debug your code. and what values get combined to produce the result.Basic Printing >(foo '(a s d f) '(a s d f)) ((A S D F) (S D F)) But this is just the same as before! Neither print function got called. so you deduce that the test must have returned nil. This should help you to recall the difference between eq and equal.
the destination should be specified as t or nil.Nicer Output Using Format Contents Next: Reading Up: Input and Output Previous: Basic Printing Nicer Output Using Format Print and its kin are useful basic printing functions. The basic structure of a format call is (format <destination> <control-string> <optional-arguments>) The full use of a destination will be introduced further below. >(format t "this") this NIL With nil as destination and no control sequences.html (1 of 3)10/19/2005 1:50:52 AM . which must be provided as optional arguments to format.~%") This shows printing with newlines.edu/~colallen/lp/node60. The control sequences may require extra arguments to be evaluated. Each ~s in the control string http://mypage. Every control sequence begins with a tilde: ~. format is more useful.iu. NIL ~s indicates that an argument is to be evaluated and the result inserted at that point. and no control sequences in the control-string. as well as control sequences. format simply returns the string: >(format nil "this") "this" Inserting ~% in the control string causes a newline to be output: >(format t "~%This shows ~%printing with ~%newlines. The control string is a string containing characters to be printed. for most basic uses. format outputs the string in a manner similar to princ. but for sophisticated and easy to read output. and returns nil. With t as the specified destination.
ftemp 32) 5/9))) (format t " ~s degrees Fahrenheit is ~s degrees Celsius " ftemp (float ctemp)) ctemp)) .) >(f-to-c 82) 82 degrees Fahrenheit is 27. If there are too many optional arguments.ftemp 32) 5/9))) (format t "~%~s degrees Fahrenheit is ftemp . For example. otherwise an error will occur. return ratio value In addition to these two control sequences it is useful to know about ~T to produce tab spacing and ~~ to print a tilde.777777777777777 degrees Celsius 250/9 Format simply evaluates the optional arguments in order they appear to determine the values for each ~s. Contents Next: Reading Up: Input and Output Previous: Basic Printing http://mypage. one with a decimal point. (float ctemp)) . print floated value . Here is an example of a function that uses this capability: (defun f-to-c (ftemp) (let ((ctemp (* (. There must be enough optional arguments following the control string to provide values for all the occurrences of ~s in the control string.edu/~colallen/lp/node60.iu. Format will also preserve newlines entered directly in the control string. i... ctemp)) . ~%~s degrees Celsius~%" first ~s second ~s return ratio value (Float converts a number from integer or ratio to a floating point number.html (2 of 3)10/19/2005 1:50:52 AM . f-to-c would behave just the same if defined as follows: (defun f-to-c (ftemp) (let ((ctemp (* (.. format evaluates them all (so side effects may occur) but no error is signalled. Some other control sequences are documented in the appendix entry for format..Nicer Output Using Format must match up to an optional argument appearing after the control string.e..
edu/~colallen/lp/node60.html (3 of 3)10/19/2005 1:50:52 AM .iu.Nicer Output Using Format © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
edu/~colallen/lp/node61.iu.html (2 of 2)10/19/2005 1:50:53 AM .Reading © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
The easiest way to handle this is with the macro with-open-file. print.edu/~colallen/lp/node62.iu. Suppose you have a file called ``foo''. Common LISP's default behavior is to send output and receive input from a stream bound to the constant *terminal-io* corresponding to the computer's keyboard and monitor. When a stream is not specified. which looks like this: this is an example of a file (that has things) we might want (to read in) http://mypage.html (1 of 4)10/19/2005 1:50:56 AM . format. hence the effects have been to interact with the keyboard and screen. that you will be reading data from the named file.Input and Output to Files Contents Next: Converting Strings to Up: Input and Output Previous: Reading Input and Output to Files All input and output in Common LISP is handled through a special type of object called a stream. in other words. with-open-file assumes that the stream is an input stream. the file must be attached to an appropriate stream. This is the general form for with-openfile: (with-open-file (<stream> <filename>) <body>) Unless specified otherwise. In all the examples so far. printing and reading has been done without specifying a stream. However. read and the other functions mentioned in this chapter allow optional specification of a different stream for input or output. Evaluating *terminal-io* shows a printed representation of this stream: >*terminal-io* #<two-way stream 0016c7a8> The designation ``two-way'' here specifies that it is a stream that is capable of handling both input and output. In order to receive input from or send output to a file.
After the body has been evaluated. The intial value of next is the result of evaluating (read infile nil 'eof). then all expressions in the body of the do are evaluated (in this case there are none). indicates that reaching the end of the file should not generate an error.html (2 of 4)10/19/2005 1:50:56 AM .Input and Output to Files 4 5 67 Here's how to get the first LISP expression from foo.) If you evaluate this code it will return the list: (THIS IS AN EXAMPLE OF A FILE (THAT HAS THINGS) WE MIGHT WANT (TO READ IN) 4 5 67) At the beginning of the do. As soon as the variables are initialized.edu/~colallen/lp/node62. The initial value of result is nil.result and next. The effects of the last two arguments in this read are explained below. and next gets updated with a new read from instream. The third argument. >(with-open-file (infile "foo") (read infile)) THIS A slightly more complicated operation is to make a list of all the expressions in foo. in this case the symbol eof. two variables are specified -. If it is true then (reverse result) is evaluated and returned. the test (equal next 'eof) is performed. In other words. This may or may not be desirable behavior. result gets next cons-ed into it. indicates what should be returned instead of an error. The second argument. Notice that choosing eof as the result to return would cause the do loop to stop if it reads the symbol eof in the middle of a file. all the variables are updated with the expressions indicated. This enables the do loop to determine when the end of file has been reached and return the appropriate result. nil in this case. If not.iu. The second and third argments to read control its behavior when it reaches the end of the file. http://mypage. The following will work: (with-open-file (infile "foo") (do ((result nil (cons next result)) (next (read infile nil 'eof) (read infile nil 'eof))) ((equal next 'eof) (reverse result)))) (See the appendix entry for `do' if you do not know how it works.
a blank line. >(with-open-file (outfile "foo" :direction :output) (prin1 '(here is an example) outfile)) (HERE IS AN EXAMPLE) And the file now contains one line: (HERE IS AN EXAMPLE) Note that it is necessary to specify the :direction as :output. For example: >(with-open-file (outfile "foo" :direction :output :if-exists :append) (print '(here is a second list) outfile)) (HERE IS A SECOND LIST) This will add a second line to the file foo.Input and Output to Files Writing to a file is very similar to reading. and the value nil is returned. The first of these options creates a file with the specified name. Notice also that this example destroyed the previous contents of foo. With-open-file assumes that a file is being opened for input by default.~%")) NIL This overwrites foo so that it contains three lines -. This behavior can be controlled with the :if-exists option.iu. a line with This is text.edu/~colallen/lp/node62.html (3 of 4)10/19/2005 1:50:56 AM . the second causes the body of the with-open-file to be ignored. which allows input and output. so this must be explicity overridden when doing file output. http://mypage. unless its behavior is controlled using the :if-does-not-exist :create or :if-does-not-exist nil options. Format can be used with the name of a stream as its first argument. so that it contains (HERE IS AN EXAMPLE) (HERE IS A SECOND LIST) With-open-file will produce an error if the file foo does not already exist. >(with-open-file (outfile "foo" :direction :output) (format outfile "~%This is text. Files may also be opened as :direction :io.
terpri. princ. prin1. Print.Input and Output to Files and another blank line. format. read and read-line all can be used with stream specifications to do file input and output.edu/~colallen/lp/node62.html (4 of 4)10/19/2005 1:50:56 AM . Contents Next: Converting Strings to Up: Input and Output Previous: Reading © Colin Allen & Maneesh Dhagat February 2005 http://mypage.iu.
see") Error: A comma has appeared out of a backquote. Broken at READ.Converting Strings to Lists Contents Next: Functions and Lambda Expressions. Up: Input and Output Previous: Input and Output Converting Strings to Lists Sometimes it is useful to convert text strings to lists. which reads one character at a time. Error signalled by READ. For example: >(string-to-list "Commas cause problems. but it returns a string. It is then possible to inspect each character and process it appropriately if it is problematic. it is much more convenient to have a list of words than a string. If the objective is to parse the input. If punctuation is likely to appear in input. this function will not work with certain kinds of punctuation.html (1 of 2)10/19/2005 1:50:57 AM .iu.edu/~colallen/lp/node63. to get substantial input. read-line is most convenient. Exactly how to do this will not be covered here as it makes a nice exercise to develop your understanding of LISP input processing. For example. then it is necessary to use read-char. Type :H for Help. http://mypage. Here is an example of code to convert a string to a list: (defun string-to-list (str) (do* ((stringstream (make-string-input-stream str)) (result nil (cons next result)) (next (read stringstream nil 'eos) (read stringstream nil 'eos))) ((equal next 'eos) (reverse result)))) >(string-to-list "this is a string of text") (THIS IS A STRING OF TEXT) Because of its reliance on read.
iu.edu/~colallen/lp/node63.html (2 of 2)10/19/2005 1:50:57 AM .Converting Strings to Lists © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
Common LISP is not a "pure" functional language. and Macros Contents Next: Eval Up: LISP Primer Previous: Converting Strings to Functions. characters. and loop features found in procedural languages. However. loops. Remmers for allowing material from his programming languages course to be incorporated into this section. because it contains constructs such as SETQ. and Macros [We are grateful to John H. and returned by operators referred to as functionals. in traditional procedural languages the first class objects are normally just passive data objects such as numbers. Some of the most important and commonly used functionals are described below. LET.edu/~colallen/lp/node64. A central feature of this paradigm is that functions are "first class" objects that can be referenced. and DOTIMES that mimic the assignment. operated upon.] LISP incorporates a "functional programming" paradigm. local scope. Lambda Expressions. By contrast. along with other elements of LISP such as eval and defmacro that support functional programming. q q q q q q q Eval Lambda Expressions Funcall Apply Mapcar Backquote and Commas Defmacro http://mypage. etc.html (1 of 2)10/19/2005 1:51:29 AM .iu. programming involves applying functionals in various ways instead of manipulating variables by assignments.Functions. In a functional language. and strings. Lambda Expressions. LISP does contain a number of functionals and supports a functional style of programming.
and Macros © Colin Allen.html (2 of 2)10/19/2005 1:51:29 AM .iu. Lambda Expressions. & Maneesh Dhagat February 2005 http://mypage.Functions.edu/~colallen/lp/node64. John H. Remmers.
See appendix entry on eval for examples.edu/~colallen/lp/node65.iu. Previous: FunctionsLambda Expressions. Any LISP expression can be passed to eval for immediate evaluation.html10/19/2005 1:53:25 AM . Eval Eval implements the second stage of the LISP interpreter's read-eval-print loop.Eval Contents Next: Lambda Expressions Up: FunctionsLambda Expressions. © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
For example: > (setf product '(lambda (x y) (* x y))) (LAMBDA (X Y) (* X Y)) > product (LAMBDA (X Y) (* X Y)) Note that in some recent versions of Common Lisp. Previous: Eval Lambda Expressions The Lambda Expression is the heart of Lisp's notion of a function. or the next step will not work. The term comes from Alonzo Church's ``lambda calculus'' -. Lambda expressions can be used in conjunction with apply to mimic function calls: > (apply product '(3 4)) 12 © Colin Allen & Maneesh Dhagat Feb 2002 http://mypage. Just like a function it has a list of parameters and a block of code specifying operations on those parameters.a development of mathematical logic.edu/~colallen/lp/node66. Use (setf product (lambda (x y) (* x y))) instead.html10/19/2005 1:53:31 AM .iu. You can think of a lambda expression as an anonymous function. the lambda expression should be unquoted.Lambda Expressions Contents Next: Funcall Up: FunctionsLambda Expressions.
the similarity is closer than this description indicates for (FUNCALL '+ 1 2 3) not only evaluates to the same result as (APPLY '+ '(1 2 3)) but also to the same result as (APPLY '+ 1 2 3 nil) © Colin Allen. except that the function arguments are at the same level as the function description instead of being in a sublist. John H.] FUNCALL is similar to APPLY.edu/~colallen/lp/node67. Remmers for allowing his material from his programming languages course to be incorporated into this section. as APPLY is typically used. Remmers. Previous: Lambda Expressions Funcall [Our thanks to John H. For example: > (FUNCALL '+ 3 5 9) 17 In fact. & Maneesh Dhagat February 2005 http://mypage.html10/19/2005 1:53:32 AM .iu.Funcall Contents Next: Apply Up: FunctionsLambda Expressions.
Apply also allows intermediate arguments between the first and the last (see appendix) but the last argument is required to be a list.edu/~colallen/lp/node68. think about how it can be used to construct complex programs on the fly. although this is not strictly what happens since apply is a function. Previous: Funcall Apply Apply takes its first argument and applies it as a function to the list of items making up the last.Apply Contents Next: Mapcar Up: FunctionsLambda Expressions. © Colin Allen & Maneesh Dhagat May 1999 http://mypage. Apply can also be used in conjunction with lambda lists. not a macro.html10/19/2005 1:53:34 AM .iu. For example: >(apply '(lambda (x y) (* x y)) '(45 67)) 3015 If this does not seem particularly useful to you. For example: >(apply '* '(1 2 3 4)) 24 You can imagine this being obtained by constructing the list (* 1 2 3 4) and evaluating the resulting list.
& Maneesh Dhagat February 2005 http://mypage. Remmers. to each element of a list and returns a list of the results. Previous: Apply Mapcar [We are grateful to John H.iu.Mapcar Contents Next: Backquote and Commas Up: FunctionsLambda Expressions. For example: > (MAPCAR 'ATOM '(DOG (CAT HORSE) FISH)) (T NIL T) > (MAPCAR '(LAMBDA (X) (* X X)) '(4 7 2 9)) (16 49 4 81) © Colin Allen.edu/~colallen/lp/node69. Remmers for allowing material from his programming languages course to be incorporated into this section. John H.] The MAPCAR form is an "iterator" that applies a function repeatedly.html10/19/2005 1:53:35 AM .
(+ 1 2)) 5) (4 3 '(3 3) 5) © Colin Allen & Maneesh Dhagat February 2005 http://mypage. and at any depth inside that context.html10/19/2005 1:53:36 AM .(+ 3 4)) (2 7) Any number of commas may appear inside a backquoted list.(+ 1 2) '(3 .iu. For example: >`(2 .edu/~colallen/lp/node70. Previous: Mapcar Backquote and Commas Backquoted lists allow evaluation of items that are preceded by commas. For example: > `(4 .Backquote and Commas Contents Next: Defmacro Up: FunctionsLambda Expressions.
iu.html (1 of 2)10/19/2005 1:53:37 AM .. but there are some crucial differences. Because expansion occurs prior to evaluation. This process is called ``macro expansion''.edu/~colallen/lp/node71. arguments passed to a macro will not necessarily be evaluated. Previous: Backquote and Commas Defmacro Macro definitions are similar to function definitions. A macro is a piece of code that creates another lisp object for evaluation.. (print 4) is evaluated 3 http://mypage. Macro expansion happens before any arguments are evaluated. Here is an example of a macro definition: > (defmacro 2plus (x) (+ x 2)) 2PLUS > (setf a 3) . This result is that macros behave rather differently from functions.Defmacro Contents Next: Appendix: Selected LISP Up: FunctionsLambda Expressions. For example: > (defmacro just-first-macro (x y) x) JUST-FIRST-MACRO > (just-first-macro 3 4) 3 > (just-first-macro 3 (print 4)) 3 .. (print 4) is not evaluated > (defun just-first-function (x y) x) JUST-FIRST-FUNCTION > (just-first-function 3 (print 4)) 4 . setf is a macro too! 3 > (2plus a) 5 In this example the form "(+ x 2)" gets expanded to "(+ a 2)" before a is evaluated.
and or are all macros.edu/~colallen/lp/node71. if.html (2 of 2)10/19/2005 1:53:37 AM . and.Defmacro Many macros are built in to Lisp. they can result in more efficient code.iu. © Colin Allen & Maneesh Dhagat May 1999 http://mypage. For example (in addition to setf) cond. Because macros do not evaluate all their arguments.
We adopt the convention of using angle brackets < > to indicate where appropriate text should be inserted when using these primitives. >= (PREDICATES) and (MACRO) append (FUNCTION) apply (FUNCTION) http://mypage. >.Appendix: Selected LISP primitives Contents Next: * (FUNCTION) Up: LISP Primer Previous: Defmacro Appendix: Selected LISP primitives Entries are described as FUNCTIONS. PREDICATES.edu/~colallen/lp/node72. Currently approximately 40 LISP primitives are documented here. so they are ignored for the sake of simplicity here. the notion of list is used when either a list or a LISP data type known as the dotted pair would be acceptable.(FUNCTION) 1+. Eventually just over 100 primitives will be documented. or SPECIAL FORMS.(FUNCTIONS) = (PREDICATE) <. MACROS.iu. the examples should make this clear.html (1 of 3)10/19/2005 1:54:25 AM . FUNCTIONS evaluate all their arguments and return a value. In many of the descriptions below. MACROS and SPECIAL FORMS do not always evaluate all their arguments. PREDICATES are functions that always return either t or nil. q q q q q q q q q * (FUNCTION) + (FUNCTION) . <=. Beginners generally need not use dotted pairs. 1.
cdar. min (FUNCTIONS) member (FUNCTION) not (PREDICATE) nth (FUNCTION) nthcdr (FUNCTION) null (PREDICATE) numberp (PREDICATE) or (MACRO) read (FUNCTION) rest (FUNCTION) reverse (FUNCTION) second. (FUNCTIONS) cdr (FUNCTION) cond (MACRO) cons (FUNCTION) defun (MACRO) do (SPECIAL FORM) documentation (FUNCTION) eql (PREDICATE) eval (FUNCTION) evenp. cddr. etc. yes-or-no-p (PREDICATES) http://mypage.iu. oddp (PREDICATES) first (FUNCTION) if (SPECIAL FORM) length (FUNCTION) let (SPECIAL FORM) list (FUNCTION) listp (PREDICATE) mapcar (FUNCTION) max.html (2 of 3)10/19/2005 1:54:25 AM . third. etc.Appendix: Selected LISP primitives q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q atom (PREDICATE) butlast (FUNCTION) car (FUNCTION) caar. (FUNCTIONS) setf (MACRO) symbolp (PREDICATE) y-or-n-p. cadr.edu/~colallen/lp/node72.
edu/~colallen/lp/node72.Appendix: Selected LISP primitives © Colin Allen & Maneesh Dhagat February 2005 http://mypage.iu.html (3 of 3)10/19/2005 1:54:25 AM .
edu/~colallen/lp/node73.. Special cases: >(* 3) 3 >(*) 1 http://mypage. Examples: >(* 4 5 6) 120 >(* 123. Argument expressions must evaluate to numbers.iu.html (1 of 2)10/19/2005 1:54:46 AM .. See below for special cases of zero or one arguments. Argument expressions are evaluated and their product is computed.0 >(* (* 2 3) 8) 48 >(* 'a 1) Error: A is not of type NUMBER.) Required arguments: None.5 12/3) 494.* (FUNCTION) Contents Next: + (FUNCTION) Up: Appendix: Selected LISP Previous: Appendix: Selected LISP * (FUNCTION) Format: (* <num1> <num2> .
edu/~colallen/lp/node73.* (FUNCTION) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html (2 of 2)10/19/2005 1:54:46 AM .iu.
(FUNCTION) Up: Appendix: Selected LISP Previous: * (FUNCTION) + (FUNCTION) Format: (+ <exp1> <exp2> . Special Cases: >(+ 3) 3 >(+) 0 http://mypage. See below for special cases of zero or one arguments..html (1 of 2)10/19/2005 1:54:53 AM .edu/~colallen/lp/node74.+ (FUNCTION) Contents Next: . Examples: >(+ 4 5 6) 15 >(+ 123.iu. Argument expressions are evaluated and their sum is computed.5 12/3) 127.5 >(+ (* 2 3) 8) 14 >(+ 'a 1) Error: A is not of type NUMBER..) Required arguments: None. Argument expressions must evaluate to numbers.
+ (FUNCTION) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html (2 of 2)10/19/2005 1:54:53 AM .iu.edu/~colallen/lp/node74.
.iu..(FUNCTION) Contents Next: 1+1.1) -1 >(. Argument expressions are evaluated and their cumulative difference is computed.1 2 3) -4 >(.1 2) -1 >(..<exp1> <exp2> .(FUNCTIONS) Up: Appendix: Selected LISP Previous: + (FUNCTION) .) Required arguments: 1 Argument expressions must evaluate to numbers.1 2 3 4) -8 © Colin Allen & Maneesh Dhagat February 2005 http://mypage.(FUNCTION) Format: (.html10/19/2005 1:54:57 AM . Examples: >(.edu/~colallen/lp/node75.
Examples: >(1+ 3) 4 >(1.iu.edu/~colallen/lp/node76. 1.(FUNCTIONS) Contents Next: = (PREDICATE) Up: Appendix: Selected LISP Previous: .(FUNCTION) 1+.1415926535897931 >(1+ (1.1+.pi) 2. 1.html10/19/2005 1:55:10 AM .(FUNCTIONS) Format: (1+ <num>) (1.<num>) Required arguments: 1 <num>: any LISP expression that evaluates to a number.3)) 3 © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
Up: Appendix: Selected LISP Previous: 1+1.iu.(FUNCTIONS) = (PREDICATE) Format: (= <num1> <num2> . <=. Examples: >(= 2) T >(= 2 3) NIL >(= 2 3 4) NIL >(= 2 2 2 2 ) T >(= 2 2 3 2) NIL >(= 2 'a) Error: A is not of type NUMBER.. must all evaluate to numbers = returns T if all the arguments are numerically equal to each other.) Required arguments: 1 <num1> must evaluate to a number Optional arguments: arbitrary <num2> .edu/~colallen/lp/node77. it returns NIL otherwise... http://mypage.= (PREDICATE) Contents Next: <>.html (1 of 2)10/19/2005 1:55:13 AM ..
iu.html (2 of 2)10/19/2005 1:55:13 AM .= (PREDICATE) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node77.
html (1 of 2)10/19/2005 1:55:16 AM . Returns T if the sequence of arguments is ordered (<: ascending.. ) Required arguments: 1 <num1> <num2> . ) (> <num1> <num2> . >. ) (<= <num1> <num2> ... Otherwise returns nil. Examples: >(< 2 67) T >(< 67 2) NIL >(> 67 2) T >(< 3 6 9) T >(< 4) T >(< 2 2 6) NIL >(<= 2 2 6) T http://mypage. >= (PREDICATES) Format: (< <num1> <num2> ..edu/~colallen/lp/node78. <=. >. <=. >: descending) or partially ordered (<=: less than or equal.. >=: greater than or equal).<...... >= (PREDICATES) Contents Next: and (MACRO) Up: Appendix: Selected LISP Previous: = (PREDICATE) <. ) (>= <num1> <num2> . must evaluate to numbers.iu.
0) NIL © Colin Allen & Maneesh Dhagat February 2005 http://mypage. >.<.edu/~colallen/lp/node78. >= (PREDICATES) >(>= 2 2 6) NIL >(< 6/2 3. <=.html (2 of 2)10/19/2005 1:55:16 AM .iu.
html10/19/2005 1:55:19 AM . Evaluation of intermediate expressions may produce side-effects.edu/~colallen/lp/node79. In the special case where and is given no arguments.iu. and (MACRO) Format: (and <exp1> <exp2> . in which case it returns NIL. Examples: >(and 3 (+ 4 5)) 9 >(and nil (print 'hello)) NIL >(and t (print 'hello) 3) HELLO 3 >(and) T © Colin Allen & Maneesh Dhagat February 2005 http://mypage. <expN>) Required arguments: None This macro evaluates its arguments in order until it reaches a nil value. or it returns the value of <expN>.and (MACRO) Contents Next: append (FUNCTION) Up: Appendix: Selected LISP Previous: <>.. <=.. it always returns T.
Each of the arguments is evaluated.append (FUNCTION) Contents Next: apply (FUNCTION) Up: Appendix: Selected LISP Previous: and (MACRO) append (FUNCTION) Format: (append <list1> <list2>.iu.. append creates a new list which has as its elements the elements of all the argument lists.html (1 of 2)10/19/2005 1:55:22 AM .<listN> <exp>) Required arguments: none Optional arguments: zero or more LISP expressions <list>: any LISP expression which returns a list.. except the last argument may be any LISP expression.edu/~colallen/lp/node80. If the last argument is not a list.. this is a dotted pair http://mypage. If all the arguments evaluate to lists. Examples: > (append '(a b) '(c d)) (A B C D) > (append '(1 (2 (3))) (i (j) k)) (1 (2 (3)) I (J) K) > (setq tmp '(fee fi fo)) (FEE FI FO) > (append tmp (list 'fum)) (FEE FI FO FUM) > (append '(fo) 'fum) (FO . FUM) > (append 'a '(1 2)) . append returns a dotted pair object. all except the last must return a list.
iu.append (FUNCTION) Error: A is not of type LIST © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node80.html (2 of 2)10/19/2005 1:55:22 AM .
edu/~colallen/lp/node81.apply (FUNCTION) Contents Next: atom (PREDICATE) Up: Appendix: Selected LISP Previous: append (FUNCTION) apply (FUNCTION) Format: (apply <func> <list>) (apply <func> <exp1> .iu. Optional arguments: arbitrary Intermediate argument expressions must evaluate to items of the correct type to which <func> can be applied Examples: >(apply '+ '(1 2 3 4)) 10 >(apply '+ 1 2 '(3 4)) 10 © Colin Allen & Maneesh Dhagat February 2005 http://mypage... <expn> <list>) Required arguments: 2 <func> must name a function or predicate (usually quoted). the last argument must be a list.html10/19/2005 1:55:27 AM .
Examples: > (atom 'hello) T > (atom "hello") T > (atom 4.edu/~colallen/lp/node82. atom returns T.iu.html10/19/2005 1:55:31 AM .6434) T > (atom '(hello "hello" 4. numbers and strings are all considered LISP atoms. Symbols.6434)) NIL © Colin Allen & Maneesh Dhagat February 2005 http://mypage. else it returns NIL.atom (PREDICATE) Contents Next: butlast (FUNCTION) Up: Appendix: Selected LISP Previous: apply (FUNCTION) atom (PREDICATE) Format: (atom <exp>) Required arguments: 1 <exp> can be any LISP expression The argument expression is evaluated. If the value returned by this evaluation represents a LISP atom.
If butlast is given an integer second argument.e. it will return the list argument with the last element removed. it will remove the number of elements specified from the end of the list. I. I.html (1 of 2)10/19/2005 1:55:36 AM .iu.edu/~colallen/lp/node83.butlast (FUNCTION) Contents Next: car (FUNCTION) Up: Appendix: Selected LISP Previous: atom (PREDICATE) butlast (FUNCTION) Format: (butlast <list>) (butlast <list> <int>) Required arguments: 1 First argument must evaluate to a list Optional arguments: 1 <int> must evaluate to an integer If butlast is used with a single argument then it is equivalent to (reverse (rest (reverse <list>))). Examples: >(butlast '(a s d f)) (A S D) >(butlast '(a s d f) 2) (A S) >(butlast '(a s d f) 0) (A S D F) >(reverse (nthcdr 2 (reverse '(a s d f)))) (A S) http://mypage.e. it is equivalent to (reverse (nthcdr <num> (reverse <list>))).
butlast (FUNCTION) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html (2 of 2)10/19/2005 1:55:36 AM .edu/~colallen/lp/node83.iu.
cadr. cdar.html10/19/2005 1:55:40 AM . (Historical note: "CAR" is an acronym for "Contents of Address Register" which refers to the way in which linked lists were originally implemented in Lisp.) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.car (FUNCTION) Contents Next: caar.iu.edu/~colallen/lp/node84. Up: Appendix: Selected LISP Previous: butlast (FUNCTION) car (FUNCTION) car is an archaic form of the function first and the two may be used interchangeably.
cadr. (FUNCTIONS) Contents Next: cdr (Function) Up: Appendix: Selected LISP Previous: car (FUNCTION) caar. Examples: >(setf ds9 '(Sisko Kira Dax Odo Bashir OBrien)) (SISKO KIRA DAX ODO BASHIR OBRIEN) >(cadr ds9) KIRA >(cddr ds9) (DAX ODO BASHIR OBRIEN) >(cddar ds9) Error: SISKO is not of type LIST.iu. for example.edu/~colallen/lp/node85. may appear between the c and the r. cddr. etc. The function cxyr is a composition of the function cxr with cyr. a or d. etc.caar. cdar. (cadr foo) is equivalent to (car (cdr foo)). (FUNCTIONS) Format: (c-r <list>) Required arguments: 1 Argument must evaluate to a list (or cons pair). etc. cadr. Up to 3 letters. cddr.html10/19/2005 1:55:47 AM . cdar. So. © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
cdar.iu.cdr (Function) Contents Next: cond (MACRO) Up: Appendix: Selected LISP Previous: caarcadr. cdr (Function) See the entry for rest: cdr is the older name for rest. Historically its name is derived from Contents of Decrement Register.html10/19/2005 1:55:50 AM . © Colin Allen & Maneesh Dhagat January 2005 http://mypage.edu/~colallen/lp/node86. Its pronunciation rhymes with udder.
Examples: > (setq a '3) 3 > (setq b '4) 4 > (cond ((= a b) 'equal) ((< a b) 'b-is-bigger) (t 'a-is-bigger)) B-IS-BIGGER > (setq action 'square-both) SQUARE-BOTH > (cond ((equal action 'clear-both) (setq a 0) http://mypage. If no successful <test> expression is found. If a successful <test> expression is found. For this clause. <test> is any LISP expression.edu/~colallen/lp/node87. the sequence of <body> expressions are evaluated and the value of the last expression is returned as the result of cond.html (1 of 2)10/19/2005 1:55:54 AM . cond returns NIL.cond (MACRO) Contents Next: cons (FUNCTION) Up: Appendix: Selected LISP Previous: cdr (Function) cond (MACRO) Format: (cond (<test1> <body1>) (<test2> <body2>) . . until one is found whose value is non-NIL. (<testN> <bodyN>)) Required arguments: none Optional arguments: zero or more (<test> <body>) clauses Here.iu. but its clause contains no <body> expressions. Each <test> expression is evaluated in turn. The <body> is a sequence of zero or more LISP expressions. the result of the <test> expression is returned as the result of cond.
iu. a was 9 due to previous . strange use of cond . before this.edu/~colallen/lp/node87.html (2 of 2)10/19/2005 1:55:54 AM .cond (MACRO) (setq b 0)) ((equal action 'square-both) (setq a (* a a)) (setq b (* b b))) ((equal action 'square-a) (setq a (* a a))) ((equal action 'square-b) (setq b (* b b)))) 16 > (cond ((= a 5) 'found) ((= b 5) 'found)) NIL > (cond ((+ a 1))) 10 . cond clauses © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
html (1 of 2)10/19/2005 1:55:59 AM .iu.another dotted pair http://mypage. In common usage.edu/~colallen/lp/node88. cons returns the dotted pair of the values of the two expressions. Q) .cons (FUNCTION) Contents Next: defun (MACRO) Up: Appendix: Selected LISP Previous: cond (MACRO) cons (FUNCTION) Format: (cons <exp1> <exp2>) Required arguments: 2 <exp1>: any LISP expression <exp2>: any LISP expression Both argument expressions are evaluated. cons creates a new copy of the list returned by <expr2>..a dotted pair . if <expr2> returns an atom. In this case. Examples: > (cons 'a '(1 2 3)) (A 1 2 3) > (cons '(a) '(1 2 3)) ((A) 1 2 3) > (setq a 3) 3 > (cons a (list i j k)) (3 I J K) > (cons 'a a) (A .. and makes the value returned by <expr1> the new first element in this list. the second expression usually returns a list. However. 3) > (cons '(1 2) 'q) ((1 2) .
cons (FUNCTION) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.iu.html (2 of 2)10/19/2005 1:55:59 AM .edu/~colallen/lp/node88.
. Examples: > (defun square (x) (* x x)) SQUARE > (square 4) 16 > (square (+ 7 -2)) 25 > (defun equal-length (lst1 lst2) http://mypage. This list specifies the number and order of arguments in a function call. defun returns the name of the function.): a list of zero or more symbols which are appropriate as parameter names Optional arguments: 1 <body>: a sequence of zero or more LISP expressions The arguments to defun are not evaluated---they are used to establish a procedure definition.edu/~colallen/lp/node89. is determined by the value of corresponding argument in the function call. The first argument is a symbol which specifies the name of the function.defun (MACRO) Contents Next: do (SPECIAL FORM) Up: Appendix: Selected LISP Previous: cons (FUNCTION) defun (MACRO) Format: (defun <name> (<par1> <par2> .iu. This name can later be used to execute the <body> of the function. The parameter-list follows the name. (<par1> <par2> . <par>. Each <par> is symbol which may appear in the <body>....html (1 of 2)10/19/2005 1:56:02 AM . The value of each parameter. <parN>) <body>) Required arguments: 2 <name>: a symbol which is appropriate as the name of function.
edu/~colallen/lp/node89.defun (MACRO) (cond ((= (length lst1) (length lst2)) t) (t nil))) EQUAL-LENGTH > (equal-length '(a b c) '((d e) f g)) T > (equal-length '() (rest '(a b))) NIL > (defun side-effect (x y) (setq x (* x x x)) (+ x y)) SIDE-EFFECT > (side-effect 2 3) 11 > (side-effect -4 14) -50 © Colin Allen & Maneesh Dhagat November 2004 http://mypage.iu.html (2 of 2)10/19/2005 1:56:02 AM .
" © Colin Allen & Maneesh Dhagat February 2005 http://mypage. including constants) TYPE (types defined by DEFTYPE) STRUCTURE (structures defined by DEFSTRUCT) SETF (SETF methods defined by DEFSETF." >(documentation 'pi 'variable) " The floating-point number that is appropriately equal to the ratio of the circumference of the circle to the diameter. structure.edu/~colallen/lp/node91. Returns NIL if LIST is NIL." >(documentation 'cdr 'function) " Args: (list) Returns the cdr of LIST. variable. macros. and DEFINE-MODIFY-MACRO) All built-in special forms. functions. macros. Examples: >(documentation 'documentation 'function) " Args: (symbol doc-type) Returns the doc-string of DOC-TYPE for SYMBOL.html10/19/2005 1:59:26 AM . NIL if none exists. type. Possible doc-types are: FUNCTION (special forms.iu. or setf (see below) This function is useful from the command line for a quick reminder of the format and usage of certain LISP primitives. and functions) VARIABLE (dynamic variables.documentation (FUNCTION) Contents Next: eql (PREDICATE) Up: Appendix: Selected LISP Previous: do (SPECIAL FORM) documentation (FUNCTION) Format: (documentation <func> <type>) Required arguments: 2 <func> must evaluate to the name of a function <type> must be function. DEFINE-SETF-METHOD. and variables have their doc-strings. See examples below. Both arguments are usually quoted symbols.
If they both return atoms. In contrast.eql (PREDICATE) Contents Next: eval (FUNCTION) Up: Appendix: Selected LISP Previous: documentation (FUNCTION) eql (PREDICATE) Format: (eql <exp1> <exp2>) Required arguments: 2 <exp1>: any LISP expression <exp2>: any LISP expression Both argument expressions are evaluated. If they return lists. two values can be ``equal'' if they are copies of one another (perhaps existing in different memory locations).iu.edu/~colallen/lp/node92. Examples: > (eql T > (eql T > (eql NIL > (eql NIL 'hello 'hello) -19 -19) 2 3) '(1 2 3) '(1 2 3)) > (setq a '(1 2 3)) (1 2 3) > (setq b '(1 2 3)) (1 2 3) > (eql a b) NIL > (setq c a) http://mypage. eql returns T only if the lists are represented by the same object in memory.html (1 of 2)10/19/2005 1:59:37 AM . eql returns T if they are the same.
equal returns T. In contrast. If the values returned are copies of one another (or even are physically the same by occupying the same memory). Examples: > (equal 'hey 'hello) NIL > (equal -81 -81) T > (equal '(1 (2 3)) '(1 (2 3))) T > (setq a '(1 2 3)) (1 2 3) > (setq b '(1 2 3)) (1 2 3) > (equal a b) T > (setq c a) (1 2 3) > (equal a c) T © Colin Allen & Maneesh Dhagat February 2005 http://mypage.iu. for two lists to be eql they must represent the same object in memory.html (2 of 2)10/19/2005 1:59:37 AM .eql (PREDICATE) (1 2 3) > (eql a c) T > (eql b c) NIL Format: (equal <exp1> <exp2>) Required arguments: 2 <exp1>: any LISP expression <exp2>: any LISP expression Both argument expressions are evaluated.edu/~colallen/lp/node92.
iu. http://mypage. It causes the evaluation of whatever <exp> returns. if <exp> is an evaluable LISP expression that returns an evaluable LISP expression. Examples: >(eval '(+ 1 2)) 3 >(eval (cons '+ '(1 2))) 3 >(eval 3) 3 >(eval (+ 3 4)) 7 >(eval (cons 'a '(s d f))) Error: The function A is undefined. then eval returns the value of evaluating this second expression.html (1 of 2)10/19/2005 1:59:41 AM . eval provides direct access to the LISP expression evaluator. Thus.eval (FUNCTION) Contents Next: evenpoddp (PREDICATES) Up: Appendix: Selected LISP Previous: eql (PREDICATE) eval (FUNCTION) Format: (eval <exp>) Required arguments: 1 <exp>: any LISP expression.edu/~colallen/lp/node93.
iu.edu/~colallen/lp/node93.eval (FUNCTION) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html (2 of 2)10/19/2005 1:59:41 AM .
Returns T if the value of <num> is even (odd).html10/19/2005 1:59:44 AM . © Colin Allen & Maneesh Dhagat February 2005 http://mypage. oddp (PREDICATES) Contents Next: first (FUNCTION) Up: Appendix: Selected LISP Previous: eval (FUNCTION) evenp.evenp.edu/~colallen/lp/node94. Examples: >(oddp 3) T >(oddp 68) NIL >(evenp 4.0) Error: 4. NIL otherwise.0 is not of type INTEGER.iu. oddp (PREDICATES) Format: (evenp <num>) (oddp <num>) Required arguments: 1 <num>: any LISP expression that evaluates to an integer.
If the list is empty. first returns nil. first returns the first element of this list.edu/~colallen/lp/node95. i.e. is nil.first (FUNCTION) Contents Next: if (SPECIAL FORM) Up: Appendix: Selected LISP Previous: evenpoddp (PREDICATES) first (FUNCTION) Format: (first <exp>) Required arguments: 1 <exp>: any LISP expression which returns a list The argument expression must evaluate to a list.iu. Examples: > (first '(1 2 3)) 1 > (first '((a (b (c)) d) e (f))) (A (B (C)) D) > (first ()) NIL > (first 'a) Error: A is not of type LIST © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html10/19/2005 1:59:48 AM .
if it returns a value other than NIL. Otherwise the result of evaluating <else>is returned.iu.edu/~colallen/lp/node96. If <test> evaluates to NIL.html (1 of 2)10/19/2005 1:59:51 AM . NIL is returned.4 3) (. if returns the result of evaluating the <then> expression. and no <else> expression is provided.if (SPECIAL FORM) Contents Next: length (FUNCTION) Up: Appendix: Selected LISP Previous: first (FUNCTION) if (SPECIAL FORM) Format: (if <test> <then> <else>) Required arguments: 2 <test>: any LISP expression <then>: any LISP expression Optional arguments: 1 <else>: any LISP expression The <test> expression is evaluated. Examples: >(if (> 4 3) 4 3) 4 >(if (< 4 3) (.3 4)) -1 >(if (= 4 3) t) NIL © Colin Allen & Maneesh Dhagat http://mypage.
iu.if (SPECIAL FORM) November 2004 http://mypage.edu/~colallen/lp/node96.html (2 of 2)10/19/2005 1:59:51 AM .
Examples: >(length '(1 2 3 4 5)) 5 >(length "1 2 3 4 5") 9 >(length (make-array 3)) 3 >(length nil) 0 © Colin Allen & Maneesh Dhagat February 2005 http://mypage. string) Returns the length of the given sequence. array.g.iu.html10/19/2005 1:59:54 AM .length (FUNCTION) Contents Next: let (SPECIAL FORM) Up: Appendix: Selected LISP Previous: if (SPECIAL FORM) length (FUNCTION) Format: (length <exp>) Required arguments: 1 <exp> must evaluate to a sequence (e.edu/~colallen/lp/node97. list. vector.
Examples: >(let ((a) (b)) (and (not a) (not b))) T >(let ((a 3) (b 4)) (setf a (+ a b)) (setf b (+ a b)) (+ a b)) 18 http://mypage.): a list of zero or more lists having the form (<var>) or (<var> <init>).. Otherwise. let evaluates all the expressions in <body> and returns the value of the last.html (1 of 2)10/19/2005 1:59:57 AM . <var> must be a symbol appropriate as the name of a variable. it is initially bound to NIL. Optional arguments: arbitrary <body>: any sequence of zero or more LISP expressions.edu/~colallen/lp/node98. If a <var> is not accompanied by an <init> expression.let (SPECIAL FORM) Contents Next: list (FUNCTION) Up: Appendix: Selected LISP Previous: length (FUNCTION) let (SPECIAL FORM) Format: (let ((<var1> <init1>) (<var2> <init2>) . (<varN> <initN>)) <body>) Required arguments: 1 ((<var> <init>). or NIL if there are none. <init> may be any LISP expression.. <init> is evaluated and assigned as the value of <var>. . The <var>'s are established as local variables for the expressions in <body>.iu.
iu.html (2 of 2)10/19/2005 1:59:57 AM .edu/~colallen/lp/node98.let (SPECIAL FORM) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
.<expN>) Required arguments: none Optional arguments: arbitrary <exp1>. Examples: >(list 'picard 'riker 'worf 'crusher) (PICARD RIKER WORF CRUSHER) >(list 'picard '(riker worf crusher)) (PICARD (RIKER WORF CRUSHER)) >(list 1 (+ 1 1) (+ 1 1 1) (+ 1 1 1 1)) (1 2 3 4) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.list (FUNCTION) Contents Next: listp (PREDICATE) Up: Appendix: Selected LISP Previous: let (SPECIAL FORM) list (FUNCTION) Format: (list <exp1> <exp2>.html10/19/2005 2:00:00 AM .<expN>: any sequence of zero or more LISP expressions..edu/~colallen/lp/node99.iu. All the <arg>'s are evaluated and the resulting values are returned as elements of a list...
html10/19/2005 2:00:03 AM . NIL otherwise. Examples: >(listp '(a s d f)) T >(listp 3) NIL >(listp (cons '1 '(2 3 4))) T © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Returns T if <exp> is of the data type list.listp (PREDICATE) Contents Next: mapcar (FUNCTION) Up: Appendix: Selected LISP Previous: list (FUNCTION) listp (PREDICATE) Format: (listp <exp>) Required arguments: 1 <exp>: any LISP expression.edu/~colallen/lp/node100.iu.
Subsequent arguments must evaluate to lists.mapcar (FUNCTION) Contents Next: maxmin (FUNCTIONS) Up: Appendix: Selected LISP Previous: listp (PREDICATE) mapcar (FUNCTION) Format: (mapcar <func> <lis1> .edu/~colallen/lp/node101. <lisN>) Required arguments: 2 First argument names a function (usually quoted). second.html (1 of 2)10/19/2005 2:00:06 AM .iu. Examples: >(mapcar '+ '(1 2 3)) (1 2 3) >(mapcar '+ '(1 2 3) '(4 5 6)) (5 7 9) >(mapcar '+ '(1 2 3) '(4 5 6) '(7 8 9)) (12 15 18) >(mapcar '+ '(1 2) '(3 4 5)) (4 6) >(mapcar '< '(1 2 3) '(4 5 0)) (T T NIL) >(mapcar '< '(1 2 3) '(4 5)) (T T) http://mypage. third. up to the length of the shortest list provided. elements of the subsequent arguments and returns a list of the results. . . Mapcar applies the named function successively to the first. etc.
edu/~colallen/lp/node101.html (2 of 2)10/19/2005 2:00:06 AM .iu.mapcar (FUNCTION) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
.. <numN>) Required arguments: 1 <num1> .. min (FUNCTIONS) Format: (max <num1> . min (FUNCTIONS) Contents Next: member (FUNCTION) Up: Appendix: Selected LISP Previous: mapcar (FUNCTION) max.iu.0) -12 >(max 3) 3 >(min 4) 4 © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html10/19/2005 2:00:10 AM ..edu/~colallen/lp/node102. Examples: >(max 1 4 3 15 (* 9 2)) 18 >(min 3 4 (.. <numN>) (min <num1> .7 19) 5 6. <numN> must all evaluate to numbers Returns the numerical maximum (minimum) of the arguments given..max.
member returns a list beginning with the first UNmatched element of <list>.member (FUNCTION) Contents Next: not (PREDICATE) Up: Appendix: Selected LISP Previous: maxmin (FUNCTIONS) member (FUNCTION) Format: (member <item> <list> :test <test> :test-not <test-not> :key <key>) Required arguments: 2 <item>: Any LISP expression <list>: A expression which returns a list Keyword arguments: 3 <test>/<test-not>: A function or lambda expression that can be applied to compare <item> with elements of <list>. eq is used. If <testnot> is specified. rather than to the element itself. a list containing all the elements from <item> to the end of <list> is returned. Otherwise NIL is returned. <key>: A function or lambda expression that can be applied to elements of <list>. otherwise <test> is used. Examples: >(member 'riker '(picard riker worf crusher)) (RIKER WORF CRUSHER) >(member '(lieutenant worf) '((captain picard) (commander riker) (lieutenant worf) (ensign crusher))) NIL http://mypage. Specifying a <key> causes member to compare <item> with the result of applying <key> to each element of <list>. The elements of <list> are compared with the <item>.iu.edu/~colallen/lp/node103. If <test> is not specified. If <item> is found to match an element of <list>.html (1 of 2)10/19/2005 2:00:13 AM .
member (FUNCTION) >(member '(lieutenant worf) '((captain picard) (commander riker) (lieutenant worf) (ensign crusher)) :test #'equal) ((LIEUTENANT WORF) (ENSIGN CRUSHER)) >(member 'picard '(picard riker worf crusher) :test-not #'eq) (RIKER WORF CRUSHER) >(member 'worf '((captain picard) (commander riker) (lieutenant worf) (ensign crusher)) :key #'second) ((LIEUTENANT WORF) (ENSIGN CRUSHER)) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html (2 of 2)10/19/2005 2:00:13 AM .edu/~colallen/lp/node103.iu.
html10/19/2005 2:00:15 AM . See entry for null. © Colin Allen & Maneesh Dhagat February 2005 http://mypage. its use is preferred for when <exp> is not a list.not (PREDICATE) Contents Next: nth (FUNCTION) Up: Appendix: Selected LISP Previous: member (FUNCTION) not (PREDICATE) Format: (not <exp>) Required arguments: 1 <exp>: any LISP expression.iu.edu/~colallen/lp/node104. Not is identical to null.
Examples: >(nth 0 '(picard riker work crusher)) PICARD >(nth 2 '((captain picard) (commander riker) (lieutenant worf) (ensign crusher))) (LIEUTENANT WORF) © Colin Allen & Maneesh Dhagat February 2005 http://mypage. 0 indicates the first element of <list>. 1 the second.html10/19/2005 2:00:18 AM . <list>: any expression which returns a list. etc. The function nth returns the indexed element of <list>.iu.nth (FUNCTION) Contents Next: nthcdr (FUNCTION) Up: Appendix: Selected LISP Previous: not (PREDICATE) nth (FUNCTION) Format: (nth <index> <list>) Required arguments: 2 <index>: any expression which returns a positive integer (fixnum). <index> must be a non-negative integer.edu/~colallen/lp/node105. An index past the end of the list will cause nth to return nil.
<list>: any expression which returns a list. The function nth returns the <list> with the first n elements removed.html (1 of 2)10/19/2005 2:00:21 AM . <index> must be a nonnegative integer.edu/~colallen/lp/node106.iu.nthcdr (FUNCTION) Contents Next: null (PREDICATE) Up: Appendix: Selected LISP Previous: nth (FUNCTION) nthcdr (FUNCTION) Format: (nthcdr <index> <list>) Required arguments: 2 <index>: any expression which returns a positive integer (fixnum). Examples: >(setf ds9 '(Sisko Kira Dax Odo Bashir OBrien)) (SISKO KIRA DAX ODO BASHIR OBRIEN) >(nthcdr 0 ds9) (SISKO KIRA DAX ODO BASHIR OBRIEN) >(nthcdr 1 ds9) (KIRA DAX ODO BASHIR OBRIEN) >(nthcdr 3 ds9) (ODO BASHIR OBRIEN) >(nthcdr 2345 ds9) NIL © Colin Allen & Maneesh Dhagat February 2005 http://mypage. An index past the end of the list will cause nthcdr to return nil.
nthcdr (FUNCTION) http://mypage.html (2 of 2)10/19/2005 2:00:21 AM .edu/~colallen/lp/node106.iu.
edu/~colallen/lp/node107. null is just the same as not. NIL otherwise.html10/19/2005 2:00:24 AM . Examples: >(null '(picard riker)) NIL >(null (rest '(picard))) T © Colin Allen & Maneesh Dhagat February 2005 http://mypage. but is the preferred form to use when the purpose is to test whether a list is empty.null (PREDICATE) Contents Next: numberp (PREDICATE) Up: Appendix: Selected LISP Previous: nthcdr (FUNCTION) null (PREDICATE) Format: (null <exp>) Required arguments: 1 <exp>: any LISP expression The predicate null returns T if <expr> evaluates to the empty list.iu.
html10/19/2005 2:00:27 AM .numberp (PREDICATE) Contents Next: or (MACRO) Up: Appendix: Selected LISP Previous: null (PREDICATE) numberp (PREDICATE) Format: (numberp <exp>) Required arguments: 1 <exp>: any LISP expression The predicate numberp returns T if <exp> evaluates to a number (i.23)) T >(numberp #C(1. or complex). Examples: >(numberp 1/2) T >(numberp 1235439) T >(numberp (/ 5 1. float. an object of type integer.2 -0.e.9)) T >(numberp '(+ 1 2 3)) NIL © Colin Allen & Maneesh Dhagat February 2005 http://mypage. ratio.edu/~colallen/lp/node108. numberp returns NIL otherwise.iu.
in which case it returns that value.. it always returns nil. Evaluation of intermediate expressions may produce side-effects. Examples: >(or 3 (+ 4 5)) 3 >(or nil (print 'hello)) HELLO HELLO >(or nil '(print hello) 3) (PRINT HELLO) >(or) NIL © Colin Allen & Maneesh Dhagat February 2005 http://mypage.or (MACRO) Contents Next: read (FUNCTION) Up: Appendix: Selected LISP Previous: numberp (PREDICATE) or (MACRO) Format: (or <exp1> <exp2> . In the special case where and is given no arguments. <expn>) Required arguments: None This macro evaluates arguments in order until it reaches a non-nil value.html10/19/2005 2:00:30 AM .. or it returns nil.edu/~colallen/lp/node109.iu.
the the end of file is reported as occurring between objects. no error results. read waits for input from the standard input (usually the keyboard) and returns a LISP object.iu. input is taken from the stream rather than standard input. <recursive> controls the kind of error that is signalled when an end of file is encountered. then the end of file is reported to have occurred in the middle of reading in an object.'' If <eof-error> is nil. then encountering the end of a file during a read will cause an error to occur.'' If <eof-error> is not NIL.html10/19/2005 2:00:34 AM .edu/~colallen/lp/node110. If it is NIL. If <eof-error> is specified it controls what happens if an end of file is encountered in the middle of a ``read. Examples: See chapter 5. If <recursive> is specified and is not NIL. If <instream> is specified. and the result of <eof-value> is returned by ``read.read (FUNCTION) Contents Next: rest (FUNCTION) Up: Appendix: Selected LISP Previous: or (FUNCTION) read (FUNCTION) Format: (read <instream> <eof-error> <eof-value> <recursive>) Required arguments: none Optional arguments: 4 <instream>: an expression which returns an input stream <eof-error>: any LISP expression <eof-value>: any LISP expression <recursive>: any LISP expression Called with no arguments. © Colin Allen & Maneesh Dhagat February 2005 http://mypage.
e. Examples: > (rest '(1 2 3)) (2 3) > (rest '((a (b (c)) d) e (f))) (E (F)) > (rest '(z)) NIL > (rest ()) NIL > (rest 'a) Error: A is not of type LIST © Colin Allen & Maneesh Dhagat February 2005 http://mypage. If the list is empty. is nil. i.html10/19/2005 2:00:39 AM . rest returns nil.iu.edu/~colallen/lp/node-rest.rest (FUNCTION) Contents Next: reverse (FUNCTION) Up: Appendix: Selected LISP Previous: read (FUNCTION) rest (FUNCTION) Format: (rest <exp>) Required arguments: 1 <exp>: any LISP expression which returns a list The argument expression must evaluate to a list. rest returns all but the first element of this list.
Examples: >(reverse '(picard riker worf crusher)) (CRUSHER WORF RIKER PICARD) >(reverse (reverse '(picard riker worf crusher))) (PICARD RIKER WORF CRUSHER) >(reverse '((this list) (of words))) ((OF WORDS) (THIS LIST)) © Colin Allen & Maneesh Dhagat February 2005 http://mypage. Reverse returns a list that contains all the elements of <list> in reversed order. Up: Appendix: Selected LISP Previous: rest (FUNCTION) reverse (FUNCTION) Format: (reverse <list>) Required arguments: 1 <list>: An expression which returns a list. etc.html10/19/2005 2:00:42 AM .reverse (FUNCTION) Contents Next: secondthird.edu/~colallen/lp/node111.iu.
or nil if the list is shorter than the selected element would require. third. etc. Examples: >(second '(1 2 3 4)) 2 >(fourth '(1 2 3 4)) 4 >(ninth '(1 2 3 4)) NIL © Colin Allen & Maneesh Dhagat February 2005 http://mypage. (FUNCTIONS) Contents Next: setf (MACRO) Up: Appendix: Selected LISP Previous: reverse (FUNCTION) second. (FUNCTIONS) Format: (second <list>) (third <list>) etc. third.html10/19/2005 2:00:45 AM . etc.edu/~colallen/lp/node112.second. Required arguments: 1 The argument must evaluate to a list These functions return the obvious element from the given list.iu.
edu/~colallen/lp/node113.html (1 of 2)10/19/2005 2:00:48 AM . setf assigns the result of evaluating <val> to the location specified in the immediately preceding <place>. change parts of list structures. and to manage property lists and structures. . can be found in Steele. too numerous to document here. or (ii) an expression referring to part of a larger structure (e. or array). Examples of all these uses are given in the chapters of this book. etc. It returns the result of evaluating the last <val>. Examples: (see all chapters for further examples) >(setf crew '(picard riker worf crusher)) (PICARD RIKER WORF CRUSHER) >(setf (first crew) (second crew) (third crew) (fourth crew) (ENSIGN CRUSHER) (list (list (list (list 'captain (first crew)) 'commander (second crew)) 'lieutenant (third crew)) 'ensign (fourth crew))) http://mypage. <val>: any LISP expression. g. a list. to assign values to variables. structure. setf returns nil. If no <place>-<val> pairs are specified.iu. <placeN> <valN>) Required arguments: none Optional arguments: any even number of arguments <place>: either (i) the name of a variable. among other things.setf (MACRO) Contents Next: symbolp (PREDICATE) Up: Appendix: Selected LISP Previous: secondthird. property list. setf is used. setf (MACRO) Format: (setf <place1> <val1> <place2> <val2> . Other uses.
edu/~colallen/lp/node113.setf (MACRO) >crew ((CAPTAIN PICARD) (COMMANDER RIKER) (LIEUTENANT WORF) (ENSIGN CRUSHER)) >(setf (get 'picard 'rank) 'captain) CAPTAIN >(get 'picard 'rank) CAPTAIN >(defstruct starship crew captain) STARSHIP >(setf enterprise (make-starship)) #S(STARSHIP CREW NIL CAPTAIN NIL) >(setf (starship-crew enterprise) (rest crew) (starship-captain enterprise) (second (first crew))) PICARD >enterprise #S(STARSHIP CREW ((COMMANDER RIKER) (LIEUTENANT WORF) (ENSIGN CRUSHER)) CAPTAIN PICARD) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.html (2 of 2)10/19/2005 2:00:48 AM .iu.
Examples: >(symbolp 'this) T >(symbolp "this") NIL >(symbolp 3) NIL >(symbolp '3) NIL >(symbolp '(this is a list)) NIL >(symbolp 'pi) T >(symbolp pi) NIL http://mypage.iu.html (1 of 2)10/19/2005 2:00:51 AM . nil otherwise.edu/~colallen/lp/node114.symbolp (PREDICATE) Contents Next: y-or-n-pyes-or-no-p (PREDICATES) Up: Appendix: Selected LISP Previous: setf (MACRO) symbolp (PREDICATE) Format: (symbolp <exp>) Required arguments: 1 <exp>: any lisp expression Returns T if the argument evaluates to a symbol.
iu.symbolp (PREDICATE) © Colin Allen & Maneesh Dhagat February 2005 http://mypage.edu/~colallen/lp/node114.html (2 of 2)10/19/2005 2:00:51 AM .
yes-or-no-p (PREDICATES) Format: (y-or-n-p) (y-or-n-p <string>) (yes-or-no-p) (yes-or-no-p <string>) Required arguments: none Optional arguments: 1 Optional argument must evaluate to a string The user is prompted with the string text (if provided). but reprompts the user if given any other response. y-or-n-p returns t if y or Y is entered or nil if n or N is entered. yes-or-no-p (PREDICATES) Contents Next: About this document Up: Appendix: Selected LISP Previous: symbolp (PREDICATE) y-or-n-p. yes-or-no-p behaves similarly but requires a yes or no respsonse (upper or lower case mixed is ok).html (1 of 2)10/19/2005 2:00:54 AM .iu.y-or-n-p. Examples: >(y-or-n-p Well? (Y Well? (Y Well? (Y T "Well? ") or N) ok or N) no or N) y >(yes-or-no-p "Answer Answer in full: (Yes Answer in full: (Yes Answer in full: (Yes NIL in or or or full:") No) y No) n No) nO © Colin Allen & Maneesh Dhagat http://mypage.edu/~colallen/lp/node115.
iu.html (2 of 2)10/19/2005 2:00:54 AM .y-or-n-p. yes-or-no-p (PREDICATES) February 2005 http://mypage.edu/~colallen/lp/node115. | 47,923 | 175,556 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.828125 | 3 | CC-MAIN-2017-47 | latest | en | 0.651359 |
https://www.physicsforums.com/threads/simple-elastic-collision.814983/ | 1,508,699,684,000,000,000 | text/html | crawl-data/CC-MAIN-2017-43/segments/1508187825436.78/warc/CC-MAIN-20171022184824-20171022204824-00743.warc.gz | 960,924,023 | 16,481 | Simple Elastic Collision
1. May 21, 2015
Puddles
The problem statement, all variables and given/known data
An object of mass m1 traveling with velocity v1i has a perfectly elastic collision in which it rear ends and object of mass m2 (m2>>m1) traveling with velocity v2i. How must the velocity v1i relate to v2i if the mass m1 is to stop in its tracks (v1f=0)? What happens if velocity v1i is greater than this? If it is smaller?
Relevant equations
KE = .5mv^2
P = mv
The attempt at a solution
Cons Energy
.5m1v1i^2 + .5m2v2i^2 = .5m2v2f^2
V2f = sq.rt(( m1v1i^2 + m2v2i^2 )/(m2))
Cons Momentum
m1v1i + m2v2i = m2v2f
V2f = ( m1v1i + m2v2i )/(m2)
Set equal to each other, but my answer keeps getting more complex? It's a math error, but I'm not sure what it is…
I get to here:
(m1^2v1i^2)+(2m1v1im2v2i)+(m2^2v2i^2) = (m1v1i^2)+(m2v2i^2)
Can anyone help me continue to work this out? I'm frustrated because this is a simple problem but I can't get it.
2. May 21, 2015
Puddles
Okay, I think I found my error, I've worked out that v1i = (m2(1 - 2v2i))/(m1), how can I plug this back in to check it? I'm struggling to find a way to do so but I know there must be a way…
3. May 21, 2015
haruspex
Is there a typo there? 1-velocity is dimensionally invalid. | 459 | 1,267 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.40625 | 3 | CC-MAIN-2017-43 | longest | en | 0.910572 |
https://www.convertunits.com/from/pound/cubic+foot/to/gram/milliliter | 1,582,705,174,000,000,000 | text/html | crawl-data/CC-MAIN-2020-10/segments/1581875146187.93/warc/CC-MAIN-20200226054316-20200226084316-00012.warc.gz | 653,290,405 | 7,297 | ## ››Convert pound/cubic foot to gram/millilitre
pound/cubic foot gram/milliliter
How many pound/cubic foot in 1 gram/milliliter? The answer is 62.427962033561.
We assume you are converting between pound/cubic foot and gram/millilitre.
You can view more details on each measurement unit:
pound/cubic foot or gram/milliliter
The SI derived unit for density is the kilogram/cubic meter.
1 kilogram/cubic meter is equal to 0.062427962033561 pound/cubic foot, or 0.001 gram/milliliter.
Note that rounding errors may occur, so always check the results.
Use this page to learn how to convert between pounds/cubic foot and grams/milliliter.
Type in your own numbers in the form to convert the units!
## ››Quick conversion chart of pound/cubic foot to gram/milliliter
1 pound/cubic foot to gram/milliliter = 0.01602 gram/milliliter
10 pound/cubic foot to gram/milliliter = 0.16018 gram/milliliter
20 pound/cubic foot to gram/milliliter = 0.32037 gram/milliliter
30 pound/cubic foot to gram/milliliter = 0.48055 gram/milliliter
40 pound/cubic foot to gram/milliliter = 0.64074 gram/milliliter
50 pound/cubic foot to gram/milliliter = 0.80092 gram/milliliter
100 pound/cubic foot to gram/milliliter = 1.60185 gram/milliliter
200 pound/cubic foot to gram/milliliter = 3.20369 gram/milliliter
## ››Want other units?
You can do the reverse unit conversion from gram/milliliter to pound/cubic foot, or enter any two units below:
## Enter two units to convert
From: To:
## ››Metric conversions and more
ConvertUnits.com provides an online conversion calculator for all types of measurement units. You can find metric conversion tables for SI units, as well as English units, currency, and other data. Type in unit symbols, abbreviations, or full names for units of length, area, mass, pressure, and other types. Examples include mm, inch, 100 kg, US fluid ounce, 6'3", 10 stone 4, cubic cm, metres squared, grams, moles, feet per second, and many more! | 545 | 1,956 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.59375 | 3 | CC-MAIN-2020-10 | latest | en | 0.737795 |
artifkt.com | 1,568,907,117,000,000,000 | text/html | crawl-data/CC-MAIN-2019-39/segments/1568514573533.49/warc/CC-MAIN-20190919142838-20190919164838-00337.warc.gz | 16,919,750 | 23,495 | ## Top What Is a Constant in Math Guide!
Moreover, the decimal expansion of a number isn't necessarily unique. Unless you're someone who does a good deal of geometric calculations in your ordinary life, odds are you only ever really encounter pi once it is time to rattle off some digits for Pi Day. The majority of the proof you need to believe is there.
A subsequent paper will give a basic, high-level overview of the algorithm. What the final keyword means is that when the value was assigned, it can't be re-assigned. Nevertheless paper now it does show the correct way of making the bends and has been included for this reason.
Prime numbers are extremely special not simply in math but had special properties utilized by the ancients when added a specific means to form magnetic shapes. Let's take an instance of 2n and r. In a polynomial when it has more than one variable, add the powers of all the variables to find the degree of that term.
## The True Meaning of What Is a Constant in Math
There is an important pattern. Now you have learned a lot of the basic terms about a circle, you can comprehend the ideas to seek out its area very easily. In the Yucatan, there's a 9-step pyramid.
Following are a few illustrations of constant functions and their individual derivatives. Letters in math are called variables, or values that could change based on that which we are doing. Constants are employed in programming to earn code a little more essay writing service robust and human readable.
The best strategy is to cross-validate and pick the model with the maximum R and lowest RSS on testing error estimates. Finding a grip of the way to use drafting tools is actually helpful when constructing joints. There's more group discussion and more investigating of the way to fix formulas.
## Life, Death and What Is a Constant in Math
The calculator lacks the mathematical intuition that's very handy for finding an antiderivative, but on the other hand it can try out a substantial number of possibilities in a short period of time. Watch a real quiz bee competition when you have the possiblity to do or watch a videotaped contest on the net. With this perspective, even if the entire universe reaches zero point at a moment, this does not necessarily mean zero point after the creation of the planet is much like zero point before it.
Learning how to write out long-form computations and equations is vital, which will not only help you as soon as you don't have a calculator handy, but gives a better illustration of a particular scenario or problem you are attempting to work through. It is very important to comprehend how to create the basic graphs of linear equations before you're able to get into the more complex 3-D modeling. The initial 3 equations are definitions that you've already seen!
Parents wish to think that that they're doing a specific deed or applying https://people.eecs.ku.edu/~hossein/Teaching/Common/term-paper-proposal.pdf a particular disciplinary methodology for the youngster's own good. Poverty is no huge point to them.
It offers a comprehensive introduction to basic math abilities. Before, the proper resources was tedious and at times costly, especially if we want to think about hiring somebody to privately mentor us. When it's been a while or you know you struggled in a number of the Mechanical courses during school, you might want to have a few months to experience the material.
## Life, Death and What Is a Constant in Math
Below is a list of important Mechanical tables you should be mindful of and the section they can be located in. Symbols are a concise direction of giving lengthy instructions linked to numbers and logic. Having 1 apple won't ever signify you have 2 apples or 3 apples.
## Choosing Good What Is a Constant in Math
This change in scope is acceptable. Again the entire report is actually intriguing reading and I encourage you to look it over. So the absolute value cannot be negative.
Even with all the changes through time, it still needs a high level of competency in math and science. As a way to master mathematics, at least at the fundamental levels, you should know the language. Constant practice is the thing that brings out the finest in students.
## How to Choose What Is a Constant in Math
Among them, there are lots of inspiring achievements. Unfortunately, a few of the bots are compromised by means of a program or virus Mr. Anderson. Ergodic theory is full of things such as this.
## What Is a Constant in Math - Overview
There are several similar systems that can be modelled on exactly the same way. Your BMR ought to be about 2300 kcals. Estimating the necessary materials for an undertaking.
In order to reveal the steps, the calculator applies the exact same integration techniques a human would apply. In the subject of nondestructive evaluation it's found in formulas such as the ones used to spell out ultrasound attenuation in a material. More than proportionate increases in managerial inputs may be asked to expand output once an organization gets very large.
As it requires care of signs. After the kid is young, a number of the signs of NVLD will be physical. When kids are prepared to learn but don't learn well, it's highly probable that the downfall could possibly be on account of the teaching quality of the teachers.
# The New Angle On What Is a Mole Chemistry Just Released
Kash takes a couple fries too. Additionally, brain scans showed a few interesting patterns. The idea of a mole can be tricky to receive your head around.
## Top What Is a Mole Chemistry Secrets
Also, because you are going to have to finish 2 years syllabus, obtaining a well-structured timetable can help you to organize your Medical Preparation. So, it's suggested that in the event that you have prepared a timetable then it has to be followed properly. The upcoming logical step that ought to be followed to provide a more precise and detailed solution to the study is straightforward.
Before appearing for any competitive https://www.essay-company.com/ exam, the applicants should take note of the fundamental specifics of the examination. Many security organizations are developing facial recognition program. Its aspirants have to abide by the schedule of study and they must maintain it at any price.
Focus on boosting your calculus as it assists in handling portion aside from mechanics. Really the chances are endless. Time management is the principal aspect necessary for the exam.
Inside this chapter, you are going to learn a systematic means of naming inorganic compounds. There's no overall process to do that. From that point, you'll need to deduce the stoichiometric relationships to address the question utilizing the balanced equation.
Well since most of you probably know there isn't any atmosphere. This video will show you an illustration of how i apply the actions to address a Redox Reaction. The theory behind nuclear fusion is really quite simple.
## The Hidden Gem of What Is a Mole Chemistry
They're neither moles nor rats, but they're rodents. https://ugs.utexas.edu/tsi/tests/TSI-Assessment-Preparation If they just knew their Mr. Whiskers would need to die to develop into a walking flea repellent. Should they do, they are sure to break and each of their efforts would go waste.
All the ideas collected inside this category involved some type of activity or involvement on the customer's part. Members frequently have formal reporting relationships to people besides the team leader. He theorizes, for instance, about morphic resonancethat memories aren't simply stored in individual brains, but there's a type of collective interconnection for all species.
If this is the case, you might feel a small bummed yourself once you part ways. As soon as you deeply realize that you get started gaining control over it. Hence, it's important to realize that one may not maintain an optimum degree of concentration without taking an optimum break to recuperate.
## What Is a Mole Chemistry - Is it a Scam?
Beauty invites a specific curiosity. And that's the authentic spirit of Mole Day.
It is an essential essay writing service ingredient of succeeding. It is going to also boost up confidence. Focus more on what's right in your relationship than what's wrong.
Success isn't the secret to happiness. Insomnia is but among the few common side effects of contemporary day antidepressants. Life was trending up, and I assumed that I was able to slowly give up my antidepressant crutches.
## What is Truly Happening with What Is a Mole Chemistry
The crucial point is you could numerically relate circumference and diameter. The minimal of amount of water is utilized to keep a stable temperature to create high excellent lime slurry. The capability to lift cargo increases rapidly as you increase the measurements of the airship.
So to view how much a Zeppelin can lift we must consider the mass of the air it displaces. Loving V is similar to loving two distinct men simultaneously. Air is a combination of gases.
During the slaking process, the main measure of efficiency is the particular surface region of the calcium hydroxide particles. First lets make a collection of all of the densities of materials we wish to utilize for envelope. If you would like to craft Excavator power armor, black titanium ore is a particular resource you're going to need.
## The Upside to What Is a Mole Chemistry
In reality, I am happy I can leave her be. Instinct isn't coming from the womb knowing the way to do everything right the very first moment.
Having people read something you write is quite satisfying, but having a sizable number of folks attempt to persuade other people to read it is beyond complimentary. In the lesbian world, in regards to being in a relationship, it can become very emotional and sometimes you feel this in order to display your love, you need to be really extremelike there should be some kind of struggle or fight to be together. Be careful what type of details you share though because paper airplanes opt to fly in their very own direction and can wind up in the hands of the individual you didn't intend.
It is implied that if you're practicing at your house, so always keep the time limitation in your thoughts. You may still not have sufficient money in any particular moment, but you may still be free of lack in that exact same moment. This had become my everyday existence for the great portion of the eight decades.
Lack has turned into a collective belief system generated by the millions of human lack thought-packets that were sent out throughout our existence. That's the reason why I think that the full premise isn't right. The words on my page start to create sense.
## Who Else Wants to Learn About Help with an Essay?
An essay is the most significant part of assignment that you Read more
## Top Cheap Paper Writing Service Secrets
Technology essay writing is no different to many different essays as soon as it concerns the general rules which you Read more
## The Nuiances of Science News
One of the chief challenges is realising that there are a number of different kinds of data news out there, and not all them relevant to what you'd love to learn about. You may even customize the majority of the merchandise. They soon started looking for other ways to increase performance rather than raising clock speeds.
On the flip side, the trustworthiness term paper help of a site is decided by its affiliated sources, but Live Science does not seem to be connected with one. Social media can play an outstanding part in shaping your enterprise image, so it's important to invest in building a great social networking presence. Google Alerts are helpful for collecting EVERYTHING.
Most of us have plenty of conditions they require fulfilled, plenty of rules they require to get obeyed, and a there's lots of acting to be done in order to communicate with them without upsetting them. With very little effort you may produce the life of that person that you care about simpler and less stressful. Make a strategy to stick at it for the future, because learning how to draw well takes years.
## The Lost Secret of Science News
Folks are attracted to various people. The present government, nevertheless, https://writersworkshop.uiowa.edu/ is looking at ways to allow the people to stay where they are. The news ought to be purely new and ought to be of audience interest.
The issue can be found in the feed supplied to the livestock. Put simply, it was not the silver whatsoever, but the normal effect of just about anything being implanted directly under the top layer of the skin. There are a number of skin types and therefore, there's no single product that operates for everybody.
## What the In-Crowd Won't Tell You About Science News
Search till you have found a method you understand. Other popular self-improvement techniques work just on a conscious level. The above mentioned data looks back 15-20 years back.
The worst took place 252 million years back and is called the Great Dying. Yes, nevertheless it's indeed excellent food for thought! In reality, its best value may not fulfill the eye but always touches the soul.
Spiritual wellness is centered on expanding the feeling of purpose and meaning an individual has in their life. Symbols are just tones and patterns that give a link between our conscious reasoning and the subconscious part that produces the last choice. Research isn't perfect as it is continually evolving.
You are going to be able to vote online a couple of days before https://www.grademiners.com/essay-format the festival and it's possible to vote in person at the festival. Travel on The Trans-Siberian Railway through Russia on the opposite hand, was a very good alternate. The ideal way to encourage kids not to drink soda isn't to expose them to it at a youthful age.
## The Foolproof Science News Strategy
It's possible to purchase inexpensive but superior stock photos on the web. The website is helpful and user friendly. To make the money that you spend on ads pay off, you will need to measure and rate your ad spend based on data.
The good thing is that it's reversible if we're smart enough to discover the reason. The articles are largely readily available to anybody, but a few are only readily available to ACS members. Subscribe for articles emailed directly to your email account.
Previous research shows that Chinese parents are not as likely to reveal support for their children through affection. The present government, nevertheless, is looking at ways to allow the people to stay where they are. This issue of immigration is a popular spot for the two sides of the fence in regards to taking a stand.
## The Ugly Side of Science News
Scientists have to be enabled by social media technologies. Hence, Science is now such a significant part the human life. Modern-day zombies evolved out of predominately vodou traditions, although various varieties of undead are typical in all sorts of folklore.
As stated by the Quizno's internet homepage, as a way to franchise a Quizno's certain criteria have to be met. The author's credentials are also crucial in shaping the trustworthiness of the website because we have a tendency to believe people who obtain a high degree of education. About the Company News in Science is a site which provides news and data on the topic of science and technology.
## Science News: No Longer a Mystery
The second phase is the true post-surgical care that ought to be run by a professional voice specialist. What follows is a 10-question homeopathy quiz that I hope you will discover enjoyable. Time will tell whether they have the additional bonus of helping prevent and control type two diabetes.
It is most important to acquire the major idea. Keep in mind, it has taken years to make the life you've got today. You don't need to reside in fear of falling as you get older.
## VIVE LA FRANCE!
##### Macron Defeats Le Pen To Become France's Next President!
PARIS — The French presidential runoff transcended national politics. It was globalization against nationalism. It was the future versus the past. Open versus closed.
But in his resounding victory on Sunday night, Emmanuel Macron, the centrist who has never held elected office, won because he was the beneficiary of a uniquely French historic and cultural legacy, where many voters wanted change but were appalled at the type of populist anger that had upturned politics in Britain and the United States.
Michele Joly has been a professional interior designer and space planner since 1984. Working in New York City, Paris, France and now in Dallas, Texas.
Her earlier experience was working with Gordon Danieli Designs doing model apartments and lobbies in Manhattan for builders and developers. This lead to being asked to design the homes of the builders and many of the new tenants.
After solidly establishing herself in New York, Michele moved to France in 1988 to begin a very fulfilling and rewarding new life!
For it was in France that Michele found herself pulled by her desire to create and fabricate soft home furnishings using traditional French artisan techniques and materials. This lead to international recognition as her products were marketed by both Bergdorf Goodman and Maison et Jardin in Paris.
In time Michele started working as a attorney lawyer with individual clients and American Companies for their expatriate personnel, visit comp-attorneys.com to know more about this.
Michele wanted her clients to feel very comfortable in their new home as well as taking some things back to their home country which would remind them of their time in France. “Antiquing” was one of many such excursions that Michele made both for her clients and for herself. The “Puce” in Paris was one of her favorite shopping venues for antiquing along with going to the L’isle sur-la-Sorgue antique market in the south of france near Avignon.
After many years it was time to move back to the US and be near family. After almost two years of getting acclimated to dallas, it was time to start something new. Artifkt was created!
## GOOD STUFF
##### Another Post
Dallas-based Artifkt has relocated into a new, 800-square-foot space in Colleyville’s Tara Village Shopping Center. Owned by mother-son duo Michèle Joly and Jarrett Vogel, the boutique is an exclusive retailer of Farrow & Ball paint and wallpaper. An English brand founded in 1942, Farrow & Ball paint is made with fine ingredients including high levels of pigment and rich resin binders.
## STAR TELEGRAM
##### New Artifkt space in Colleyville is painted to perfection
Dallas-based Artifkt has relocated into a new, 800-square-foot space in Colleyville’s Tara Village Shopping Center. Owned by mother-son duo Michèle Joly and Jarrett Vogel, the boutique is an exclusive retailer of Farrow & Ball paint and wallpaper. An English brand founded in 1942, Farrow & Ball paint is made with fine ingredients including high levels of pigment and rich resin binders. | 3,868 | 19,105 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.34375 | 3 | CC-MAIN-2019-39 | longest | en | 0.952397 |
https://www.math-only-math.com/number-c.html | 1,723,755,263,000,000,000 | text/html | crawl-data/CC-MAIN-2024-33/segments/1722641316011.99/warc/CC-MAIN-20240815204329-20240815234329-00885.warc.gz | 691,709,682 | 13,194 | # Number
Using number code color the picture accordingly. All the number code represents colors of different shades.
See the color codes and color the drawing to get the final beautiful colored picture. Color the sketch with numbers mentioned in the color. Turn the boring painting into a colorful drawing. Enjoy math coloring page by using the color codes. This activity is planned to develop basic learning skills like matching, observation, recognizing differences, counting and concentrating on detail.
Kids have fun while enjoying math coloring pages. Math-Only-Math is based on the premise that children do not make a distinction between play and work and learn best when learning becomes play and play becomes learning.
Enjoy coloring using the number code:
Free kindergarten math printable worksheets have been graded systematically to help children progress naturally.
Didn't find what you were looking for? Or want to know more information about Math Only Math. Use this Google Search to find what you need.
## Recent Articles
1. ### Constructing a Line Segment |Construction of Line Segment|Constructing
Aug 14, 24 09:52 AM
We will discuss here about constructing a line segment. We know how to draw a line segment of a certain length. Suppose we want to draw a line segment of 4.5 cm length.
2. ### Construction of Perpendicular Lines by Using a Protractor, Set-square
Aug 14, 24 02:39 AM
Construction of perpendicular lines by using a protractor is discussed here. To construct a perpendicular to a given line l at a given point A on it, we need to follow the given procedure
3. ### Construction of a Circle | Working Rules | Step-by-step Explanation |
Aug 13, 24 01:27 AM
Construction of a Circle when the length of its Radius is given. Working Rules | Step I: Open the compass such that its pointer be put on initial point (i.e. O) of ruler / scale and the pencil-end be…
4. ### Practical Geometry | Ruler | Set-Squares | Protractor |Compass|Divider
Aug 12, 24 03:20 PM
In practical geometry, we study geometrical constructions. The word 'construction' in geometry is used for drawing a correct and accurate figure from the given measurements. In this chapter, we shall… | 469 | 2,204 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.375 | 4 | CC-MAIN-2024-33 | latest | en | 0.894262 |
http://www.cs.nyu.edu/pipermail/fom/2004-January/007806.html | 1,500,799,877,000,000,000 | text/html | crawl-data/CC-MAIN-2017-30/segments/1500549424296.90/warc/CC-MAIN-20170723082652-20170723102652-00116.warc.gz | 403,683,825 | 2,985 | # [FOM] 204:Finite Extrapolation
Jacques Carette carette at mcmaster.ca
Mon Jan 19 16:57:25 EST 2004
```First, do not misunderstand me: I am fascinated by this area of mathematics,
and agree that it has been under-explored. Looking at 'simplicity' instead
of 'complexity' has somehow been under-studied.
> That stuff is asymptotic, with no attempt to get any hard data. The whole
> point of my posting is to actually get hard data, overcoming a principle
> objection that is commonly made to Kolmogorov Complexity and the like.
I do not understand why you state that Kolmogorov Complexity is
'asymptotic'. True, a lot of *applications* have been asymptotic in nature,
but the theory itself is very much 'finite', in that it deals primarily with
finite strings, finite programs, and programs terminating in finite time.
Kolmogorov Complexity has been used a lot to study randomness, and here
things are indeed rather 'asymptotic'. Using it to study *simplicity*
> I believe that I have pinpointed appropriate language theoretic contexts
> where it will be highly nontrivial but feasible to start obtaining hard
data
> of an interesting kind. It is altogether too easy to spill over into
> entirely humanly intractable questions here. But I think I have avoided
> this, and come to a good place.
computable, so yes, this is definitely a good place to start. But any r.e.
language with computable length function will do. But that is not 'really'
an interesting question, now is it? It is clear that in your language,
interesting questions can be posed, but perhaps there could be a slightly
different language with the same power but with completely different
complexities?
> I addressed the issue of stability in my posting, and conjectured that
there
> is a lot of stability - more than enough to justify an intensive
> investigation of simple specific sequences.
I conjecture instead that there exists different languages than yours that
can express the same ideas but which contain classes of objects whose
complexity is not within a (universal) constant of the ones from your
language. This is what I mean by stability.
> Kolmogorov Complexity "succeeds" as you say, simply by becoming
asymptotic,
> with no hard data.
This is why I have used MDL as my principal tool instead of KC itself. And
that I had to re-interpret it in an exact setting, based on axiomatically
defined theories. And there, you can get hard data. See my paper for 2
examples of 'hard data'.
> I would imagine that you would probably now agree, upon reflection, that
> i) this proposal differs greatly from anything you have mentioned,
> especially in terms of the techniques needed to prove anything
interesting;
I do not (yet) see this.
> iii) you do not know how to answer any of the specific questions raised in
> my posting, even though they are the most obvious first questions to ask.
Which questions are these? If you mean the ones at the end of the posting,
then using gfun in Maple I can force it to give me conjectures for all your
sequences. A bit of brute force could then prove these. However, your
sequences are very short, so their information content is very very low,
possibly leading to a lot of ties.
If you mean (unstated!) interesting questions like 'There should be a
effective relation between Schanuel's Conjecture and the simplicity of a
number. Prove this', then we are really getting somewhere.
Jacques
``` | 810 | 3,441 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.609375 | 3 | CC-MAIN-2017-30 | latest | en | 0.950009 |
https://onews.info/is-1-year-1-trip-around-the-sun/ | 1,670,229,232,000,000,000 | text/html | crawl-data/CC-MAIN-2022-49/segments/1669446711013.11/warc/CC-MAIN-20221205064509-20221205094509-00329.warc.gz | 463,558,446 | 16,550 | # Is 1 year 1 trip around the sun?
## Is 1 year 1 trip around the sun?
A new year starts when Earth has made one orbit around the Sun. This takes roughly 365 days, so every new year on the last day of December, we are at the same location around the Sun as last year. This also goes for any other day during the year. New Years is a celebration of Earth's orbit around the Sun.
## How many trips is 1 year around the sun?
If we look to a high-enough precision, however, we'll find that our planet is actually spiraling away from the Sun, which causes its orbital speed to very slightly decrease over time. Every year, planet Earth completes one revolution around the Sun while spinning on its axis.
## What is a trip around the sun called?
The motion around the sun along its orbit is called a revolution. The amount of time it takes for a single trip around the sun is called a period of revolution. The period for the Earth to revolve around the sun is 365.24 days or one year.
## How many days is 2 trips around the sun?
That means in two years, you have traveled 1,168 million miles around The Sun! There are about 365 days in a year, so that equates to 730 days. If you divide 1,168 million miles by 730 days, that comes to 1.6 million miles per day! With 24 hours in a day, that equals 66,666 miles per hour!
## Is your birthday a trip around the Sun?
Enjoy the trip. A birthday is just the first day of another 365 day journey around the sun.
## Is a year 365 days around the Sun?
It takes the Earth 365-and-a-quarter days to go all the way around the Sun once. One year is 365 days, so every four years we add up the extra four quarters to make one extra day.
## How is 1 hour in space equal to 7 years on Earth?
The first planet they land on is close to a supermassive black hole, dubbed Gargantuan, whose gravitational pull causes massive waves on the planet that toss their spacecraft about. Its proximity to the black hole also causes an extreme time dilation, where one hour on the distant planet equals 7 years on Earth.
## Is a birthday a trip around the Sun?
Enjoy the trip. A birthday is just the first day of another 365 day journey around the sun.
## How long is your birthday around the Sun?
Heaven Peralejo's birthday post turned into a science discussion after she implied that “22 rotations around the sun” is equal to 22 years.
## Is 365 days a trip around the Sun?
Space is a very big place, and it takes the Earth a long time to orbit around the sun. 365 days, in fact. A period of revolution is how long it takes a planet to move around a star. It is equal to one year.
## What can I say instead of happy birthday?
Other Ways to Say HAPPY BIRTHDAY – English Study Here I hope you have a fantastic day. Have a great one! Wishin you many more candles to blow. Many happy returns of the day!
## What year is really on Earth?
Conversion
Gregorian year ISO 8601 Event
1970 +1970 Unix Epoch
1993 +1993 Publication of the Holocene calendar
2022 +2022 Current year
10000 +10000
## Do you age slower in space?
Scientists have recently observed for the first time that, on an epigenetic level, astronauts age more slowly during long-term simulated space travel than they would have if their feet had been planted on Planet Earth.
## Why don’t we age in space?
So depending on our position and speed, time can appear to move faster or slower to us relative to others in a different part of space-time. And for astronauts on the International Space Station, that means they get to age just a tiny bit slower than people on Earth. That's because of time-dilation effects.
## What does 22 trips around the sun mean?
Heaven Peralejo's birthday post turned into a science discussion after she implied that “22 rotations around the sun” is equal to 22 years. The actress marked her 22nd birthday with a stunning snap of her at the beach. The caption also caught netizens' attention.
## How old are you if your born in?
Your Age In The Next 100 Years:
This time 2022 3 years 2022
One years 4 years 2023
Two years 5 years 2024
Tree years 6 years 2025
## How many trips around the Sun is 5 years?
On the planet Earth, one trip around the sun is one Earth-year. Five trips around the sun would be equivalent to five Earth-years.
## How do you say it’s my birthday without actually saying it?
Creative and Witty Ways to Say "Happy Birthday"
1. Be happy because you will never be as young as you are today.
2. Birthday hugs and kisses incoming!
3. Congratulations on the new wrinkle on your face.
4. Happy level-up day! …
5. Happy independence day from the womb.
6. Happy womb eviction day!
7. How's the cruel world treating you?
## How do you say HBD in Japanese?
In Japanese, “happy birthday” is written (お) 誕生日 おめでとう (ございます). This is pronounced “(o) tanjoubi omedetou (gozaimasu)”.
## Was there a year 666?
Year 666 (DCLXVI) was a common year starting on Thursday (link will display the full calendar) of the Julian calendar. The denomination 666 for this year has been used since the early medieval period, when the Anno Domini calendar era became the prevalent method in Europe for naming years. Centuries: 6th century.
## How old is Jesus now?
The current year of the birth of Jesus is 2021 AD. It means that on this Christmas, Jesus will be two thousand and twenty-one years old.
## Is an hour in space 7 years on Earth?
The first planet they land on is close to a supermassive black hole, dubbed Gargantuan, whose gravitational pull causes massive waves on the planet that toss their spacecraft about. Its proximity to the black hole also causes an extreme time dilation, where one hour on the distant planet equals 7 years on Earth.
## Do astronauts get paid for life?
So, while they may not be paid for life, astronauts do receive many benefits that help offset the risks of their profession. However, astronauts may enjoy many potential financial rewards once they retire.
## Is it true that 1 hour in space is 7 years on Earth?
The first planet they land on is close to a supermassive black hole, dubbed Gargantuan, whose gravitational pull causes massive waves on the planet that toss their spacecraft about. Its proximity to the black hole also causes an extreme time dilation, where one hour on the distant planet equals 7 years on Earth.
## Can you fart in space?
On Earth, farts are typically no big deal — smelly, harmless, and they quickly dissipate. But if you're an astronaut, every fart is a ticking time bomb. The gases in farts are flammable, which can quickly become a problem in a tiny pressurized capsule in the middle of space where your fart gases have no where to go.
## Is a birthday a lap around the sun?
Why do we celebrate them? A birthday represents a lap around the sun — 365 Earth days, or 8,760 hours.
## How old is 2006 now?
So, if you were born in 2006, your current age is 16 years.
## How old is 1999 now?
So, if you were born in 1999, your current age is 23 years.
## Is your birthday a lap around the Sun?
Why do we celebrate them? A birthday represents a lap around the sun — 365 Earth days, or 8,760 hours.
## How do I say Happy Birthday in slang?
New and Different Ways to Say “Happy Birthday”
1. A million magic wishes to you!
2. A remarkable year to come!
3. All the best to you and the years to come.
4. Blow the candle and make a wish.
5. Haberday!
6. Happy anni-birth-sary!
7. Happy anniversary with life.
8. Happy Beerday! | 1,784 | 7,443 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.125 | 3 | CC-MAIN-2022-49 | latest | en | 0.950235 |
http://www.jguru.com/forums/view.jsp?EID=930943 | 1,448,589,459,000,000,000 | text/html | crawl-data/CC-MAIN-2015-48/segments/1448398447881.87/warc/CC-MAIN-20151124205407-00215-ip-10-71-132-137.ec2.internal.warc.gz | 502,059,520 | 13,285 | jGuru Forums
vector of vectors
1 posts in topic
Flat View
TOPIC ACTIONS:
Posted By: Sharen_Su
Posted On: Thursday, June 27, 2002 10:48 PM
can somebody teach me how to use vector of vectors? because i need to retrieve the data from a text file and store it into vector.(i need to make use of the data stored in vector to compute some results) problem is my data in the text file is some sort like a table.. there are columns and rows. And i don't know how to make use of vector of vector.. in my codes, i make use of arraylist.. but then i hope to use vector of vectors instead. can someone kindly help me? FileInputStream fis=new FileInputStream(f); BufferedInputStream bis = new BufferedInputStream(fis); DataInputStream dis=new DataInputStream(bis); List list = new ArrayList(); String str; while((str = dis.readLine())!= null) More>>
can somebody teach me how to use vector of vectors? because i need to retrieve the data from a text file and store it into vector.(i need to make use of the data stored in vector to compute some results) problem is my data in the text file is some sort like a table.. there are columns and rows. And i don't know how to make use of vector of vector.. in my codes, i make use of arraylist.. but then i hope to use vector of vectors instead. can someone kindly help me?
```
FileInputStream fis=new FileInputStream(f);
BufferedInputStream bis = new BufferedInputStream(fis);
DataInputStream dis=new DataInputStream(bis);
List list = new ArrayList();
String str;
{
StringTokenizer st = new StringTokenizer(str, " ");
while (st.hasMoreTokens())
{
out.println(st.nextToken()+"*");
}
out.println("
");
}
dis.close();
```
<<Less
Re: vector of vectors
Posted By: Lasse_Koskela
Posted On: Thursday, June 27, 2002 10:58 PM
`FileInputStream fis = new FileInputStream(f);BufferedInputStream bis = new BufferedInputStream(fis);DataInputStream dis = new DataInputStream(bis); String row;String col;Vector rows = new Vector();Vector cols = null;// loop through rowswhile((row = dis.readLine())!= null){ StringTokenizer st = new StringTokenizer(row, " "); // create a new Vector for each row's columns cols = new Vector(); // loop through columns while (st.hasMoreTokens()) { cols.add(st.nextToken()); } // add the column Vector to the rows Vector rows.add(cols);}dis.close();` | 557 | 2,387 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.640625 | 3 | CC-MAIN-2015-48 | latest | en | 0.787647 |
https://www.gamedev.net/forums/topic/322594-scan-conversion/ | 1,540,144,395,000,000,000 | text/html | crawl-data/CC-MAIN-2018-43/segments/1539583514162.67/warc/CC-MAIN-20181021161035-20181021182535-00272.warc.gz | 944,932,429 | 22,915 | # Scan Conversion
This topic is 4892 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.
## Recommended Posts
Many articles I read on scan conversion suggest that the polygon to be scan converted should be broken down into a top and bottom half. Are there any other methods that do not require this step? Are they unbearably inefficient? Thanks.
##### Share on other sites
Quote:
Original post by HexedAre there any other methods that do not require this step?
not that im aware of. the outline of a triangle simply is a piecewise function. nothing to be done about it. you may be able to include this fact into your code in some other way, but taking such considerations out of the innermost loop by splitting the triangle beforehand sounds like a good idea to me.
Quote:
Are they unbearably inefficient?
i think the question you should be asking is: is splitting it in two halves unbearably inefficient?
##### Share on other sites
Quote:
i think the question you should be asking is: is splitting it in two halves unbearably inefficient?
Maybe so. The equation to calculate the "dividing" point consists of one addition, two subtractions, one multiply, and one divide. Most (80%?) polys passed to this functions are probably going to be general (not flat topped or bottomed), and in a complex scene that would add up pretty quickly.
1. 1
Rutin
36
2. 2
3. 3
4. 4
5. 5
• 11
• 10
• 13
• 98
• 11
• ### Forum Statistics
• Total Topics
632974
• Total Posts
3009651
• ### Who's Online (See full list)
There are no registered users currently online
× | 388 | 1,609 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.828125 | 3 | CC-MAIN-2018-43 | latest | en | 0.916733 |
http://mathhelpforum.com/pre-calculus/146667-j-x-k-vectors.html | 1,529,750,185,000,000,000 | text/html | crawl-data/CC-MAIN-2018-26/segments/1529267864957.2/warc/CC-MAIN-20180623093631-20180623113631-00518.warc.gz | 205,793,808 | 10,460 | # Thread: j x k , vectors
1. ## j x k , vectors
Okay, I turned in a piece of homework the other day and my teacher said that I got one wrong. I was asked to solve for j x k or <0, 1, 0> x <0, 0, 1>. I said that the answer was i (<1, 0, 0>). But, try as I might that is the only answer that I am getting. Am I wrong? Is she wrong? Thanks.
2. Originally Posted by dazygrl02
Okay, I turned in a piece of homework the other day and my teacher said that I got one wrong. I was asked to solve for j x k or <0, 1, 0> x <0, 0, 1>. I said that the answer was i (<1, 0, 0>). But, try as I might that is the only answer that I am getting. Am I wrong? Is she wrong? Thanks.
Here is a complete listing:
$\displaystyle \begin{array}{lll} {i \times j = k} & {j \times k = i} & {k \times i = j} \\ {j \times i = - k} & {k \times j = - i} & {i \times k = - j} \\ \end{array}$
3. Hello, dazygrl02!
You are right . . . she is wrong.
$\displaystyle \text{Given: }\,\begin{array}{ccc}j &=& \langle 0,1,0\rangle \\ k &=& \langle 0,0,1\rangle \end{array} \quad \text{ Find: }j \times k$
I said that the answer was: .$\displaystyle i \:=\:\langle1, 0, 0\rangle$
$\displaystyle j \times k \;=\;\left|\begin{array}{ccc} i & j & k \\ 0&1&0 \\ 0&0&1\end{array}\right| \;=\;i(1-0) - j(0-0) + k(0-0) \;=\;i$
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
There is a diagram for multiplying these unit vectors.
. . $\displaystyle \begin{array}{ccccc} & & i \\ & \nearrow & & \searrow \\ k & & \leftarrow & & j \end{array}$
If the multiplication is clockwise, the product is positive.
. . $\displaystyle \begin{array}{ccc} i \times j &=& k \\ j \times k &=& i \\ k \times i &=& j \end{array}$
If the multiplication is counterclockwise, the product is negative.
. . $\displaystyle \begin{array}{ccc}j \times i &=& -k \\ k \times j &=& -i \\ i \times k &=& -j \end{array}$ | 671 | 1,866 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.0625 | 4 | CC-MAIN-2018-26 | latest | en | 0.836525 |
https://money.stackexchange.com/questions/152023/what-is-rule-for-40-year-retirement | 1,685,662,619,000,000,000 | text/html | crawl-data/CC-MAIN-2023-23/segments/1685224648209.30/warc/CC-MAIN-20230601211701-20230602001701-00504.warc.gz | 444,314,605 | 34,809 | what is rule for 40 year retirement?
For 30 year retirement 4% rule is suggested to be followed. Suppose a prospective retiree wants to plan for 40years, what should be max withdrawal rate
• The 4% "rule" is a just a rough guideline. If you need retirement to last longer then you could do 3.5%. This is subjective and opinion based so no one can give you a good answer. Aug 4, 2022 at 17:44
• The 4% rule has been justified by retrospectively using actual stock and bond returns. For every 30 year period from the 1920's on, the 4% rule on a 50/50 stock/bond portfolio was sufficient to fund a 30 year retirement. You could do (and I'm sure someone has) a similar analysis over 40 year time periods. Aug 4, 2022 at 17:51
The 4% rule is based on the results of the Trinity study that broadly found that if you had a mix of 50% stocks to 50% bonds you could withdraw 4% of the total value of the portfolio for up to 30 years and not run out of money 96% of the time. This was based on going back and looking at historical trends in the stock market and calculating the outcome of this withdrawal rate at different points in time. This article offers a more comprehensive summary and explains why the 4% rule may be even more robust than you think (assuming you have the ability to spend less than 4% when the economy is down).
So this is all probabilities-- no one can say for certain that the 4% rule will work for you whenever you choose to retire, but they can say that in the past it has worked 96% of the time. In the case of a 40 year retirement you have a 91% chance of having your money last the entire time. If you wanted to have a 96% chance of having your money last for 40 years you'd need to follow a 3.7% withdrawal rule. You can use this online calculator to mess around with the numbers and see what you get under different scenarios.
One thing worth noting-- following either the 4% rule for 30 years or 3.7% rule for 40 years-- the average outcome of these approaches actually has you doubling your initial investment by the end of the period (as measured by the median result). This helps highlight the fact that this rule is more robust than people actually give it credit for-- if you're able to withdraw less than 4% during the bad years, and compensate by withdrawing more than 4% during the good years you likely have a more than 96% chance of having your money last the whole time.
• Interesting sentence Most of the time taking only 4% meant at the end of your days you left buckets of money on the table for your (all too often ungrateful) heirs This is how I always understood the 4 % rule: the portfolio remained intact. So the strategy should work over 40 years, also. Aug 5, 2022 at 22:12 | 659 | 2,724 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.015625 | 3 | CC-MAIN-2023-23 | latest | en | 0.970828 |
https://se.mathworks.com/matlabcentral/answers/1718565-alternative-to-scatter-plot?s_tid=prof_contriblnk | 1,726,098,669,000,000,000 | text/html | crawl-data/CC-MAIN-2024-38/segments/1725700651405.61/warc/CC-MAIN-20240911215612-20240912005612-00730.warc.gz | 473,691,726 | 26,928 | # Alternative to scatter plot
19 views (last 30 days)
Christian Mathiesen on 13 May 2022
Answered: Image Analyst on 14 May 2022
I have a 3x100k matrix of scattered XYZ data over an an area that I wish to plot. So far I have been using scatter plot to visualize, but when I print the plot to .png it becomes 'blurry' like picture attached. Is there an alternative to the scatter plot take makes for a smoother image?
Thanks.
##### 3 CommentsShow 1 older commentHide 1 older comment
Jan on 13 May 2022
@Christian Mathiesen: Please mention, what you call "blurry". We do not see, what you expect instead. What should be "smoother"?
How do you "print the plot"? The image contains the icon of the axes menu. Is this a screen shot?
Christian Mathiesen on 14 May 2022
@Jan I guess I was a little vague in my explanation. I use print to save the plot as a png. I was hoping to save the plot with a better resolution by for example converting the scattered data to a grid, so there is no space inbetween each point, making for a 'smoother' figure.
Image Analyst on 14 May 2022
Create an image of desired resolution and then assign every row to a point in the image. Then use imwrite(). Something like (untested because ou forgot to upload your x,y,z data):
minX = min(x);
maxX = max(x);
minY = min(y);
maxY = max(y);
aspectRatio = (maxY - minY) / (maxX - minX)
% Make an image with 1920 columns
columns = 1920;
rows = round(aspectRatio * 1920)
grayImage = zeros(rows, columns, 'uint8');
% Rescale x and y so they will be within the image dimensions.
xs = round(rescale(x, 1, columns));
ys = round(rescale(y, 1, rows));
zs = uint8(rescale(z, 0, 255)); % Convert z to gray levels in the range 0-255
% Assign pixels
for k = 1 : length(x)
grayImage(ys(k), xs(k)) = zs(k);
end
imshow(grayImage, []);
impixelinfo;
axis('on', 'image');
### Categories
Find more on Discrete Data Plots in Help Center and File Exchange
R2022a
### Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting! | 553 | 2,041 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.625 | 3 | CC-MAIN-2024-38 | latest | en | 0.831871 |
http://www.brainbashers.com/sudokuhelpxyzwing.asp | 1,498,713,811,000,000,000 | text/html | crawl-data/CC-MAIN-2017-26/segments/1498128323870.46/warc/CC-MAIN-20170629051817-20170629071817-00244.warc.gz | 452,003,704 | 3,216 | [OK] Privacy Policy - Terms & Conditions - See DetailsWe use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information you've provided to them or they've collected from your use of their services.
Home - Puzzles - Illusions - Fun Stuff - Sudoku - Random - Today - The Button [New] - Number Battle [New]
XYZ-Wing An XYZ-Wing is a very advanced technique which can eliminate certain candidates from squares and is a very similar technique to XY-Wing. We are looking for three squares. This time the first square contains XYZ and we require a buddy of this square to contain XZ. We then require another buddy of the XYZ square to contain YZ. Any squares that are buddies to all three squares, XYZ, XZ & YZ cannot contain Z. Why? Because no matter which way around the numbers go, the Z will be in one of the three squares. In this Sudoku X=7, Y=8 & Z=9. R4C4 is XYZ. R4C2 is XZ. R6C4 is YZ. So no buddies of all three squares R4C4, R4C2 & R6C4 can contain <9>. In this Sudoku X=6, Y=3 & Z=2. R8C8 is XYZ. R8C2 is XZ. R9C8 is YZ. So no buddies of all three squares R8C8, R8C2 & R9C8 can contain <2>.
BrainBashers™ is a trademark. We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information you've provided to them or they've collected from your use of their services. For more information please view our privacy policy. By using the site you also agree to our terms and conditions. | 474 | 1,796 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.171875 | 3 | CC-MAIN-2017-26 | longest | en | 0.895486 |
https://www.privatetutoringathome.com/critical-reasoning-question-8-violent-crime/ | 1,725,839,488,000,000,000 | text/html | crawl-data/CC-MAIN-2024-38/segments/1725700651035.2/warc/CC-MAIN-20240908213138-20240909003138-00356.warc.gz | 911,706,054 | 10,805 | # Critical Reasoning Question 8-Violent Crime
The rate of violent crime in this state is up 30% from last year. The fault lies entirely in our court system: Recently our judges’ sentences have been so lenient that criminals can now do almost anything without fear of a long prison term.
The argument above would be weakened if it were true that
A. 85% of the other states in the nation have lower crime rates than does this state
B. White-collar crime in this state has also increased by over 25% in the last year
C. 35% of the police in this state have been laid off in the last year due to budget cuts
D. Polls show that 65% of the population in this state oppose capital punishment
E. The state has hired 25 new judges in the last year to compensate for deaths and retirements
If we can show that something besides the court system may explain the increase in crime (if we can show a different cause for the same effect) we would weaken the argument. The author, after all, assumes that there is no other cause ( a common GMAT assumption). Tackle the choices, looking for another cause besides the allegedly lenient court sentences.
(A) is a classic faulty comparison. The argument does not compare one state to another. The argument’s scope is the crime rate increase in this state only. In (B), the fact that white-collar crime is also on the rise is more of a strengthener than a weakener-maybe it is the leniency in the courtroom that is responsible for an overall crime surge. (C) presents an alternative explanation for the increase in crime. Maybe it is not the judges at all but the fact that there are fewer cops on the street. As for (D), what if 65% of people in the state oppose capital punishment? what if 100% of people in this state oppose capital punishment? This provides little insight into why crime has gone up since last year. (E) tells us that numerous judges have been replaced in the last year. It is possible that the new judges are more lenient, but this would only strengthen the author’s conclusion.
### Enjoy All The Benefits
You don’t pay your first hour unless you find it a good fit.
Only pay for the time you need.
No subscriptions or upfront payments.
Find Tutors Near You | 521 | 2,241 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.921875 | 3 | CC-MAIN-2024-38 | latest | en | 0.951327 |
https://vlab.amrita.edu/?sub=77&brch=270&sim=1677&cnt=3 | 1,611,230,233,000,000,000 | text/html | crawl-data/CC-MAIN-2021-04/segments/1610703524743.61/warc/CC-MAIN-20210121101406-20210121131406-00365.warc.gz | 624,591,055 | 7,138 | . .
.
AC Flywheel battery
.
.
1) Turning moment diagram is a graph between Torque and crank radius Torque and Crank angle none of the above Force and crank radius
2) The energy is stored in Flywheel in form of Kinetic energy Potential energy Electrical energy Heat energy
3) The radius of Gyration (k) for Rim Type Flywheel having radius ‘r’ is given by k = 2r k=r/2 k=r k=r/3
4) The coefficient of fluctuation of speed of Flywheel is given by (Note:N1 =Maximum speed, N2 = Minimum speed, N = Mean speed.) (N1-N2) x N (N1-N2)/N (N1+N2) x N (N1+N2)/N
5) The Coefficient of fluctuation of energy of flywheel is given as (note: Emax = Maximum Kinetic energy of the Flywheel. Emin = Minimum Kinetic energy of the Flywheel ) (Emax + Emin) x Work done per cycle (Emax – Emin) x Work done per cycle (Emax + Emin)/Work done per cycle (Emax – Emin)/Work done per cycle
6) In industries which electrical braking is preferred? Regenerative braking. Plugging. Dynamic braking. None of the above.
Cite this Simulator:
.....
..... .....
Copyright @ 2021 Under the NME ICT initiative of MHRD | 313 | 1,098 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.734375 | 3 | CC-MAIN-2021-04 | latest | en | 0.856632 |
https://www.queryhome.com/puzzle/27208/whats-minimum-number-straight-required-pizza-pieces-equal | 1,561,010,178,000,000,000 | text/html | crawl-data/CC-MAIN-2019-26/segments/1560627999141.54/warc/CC-MAIN-20190620044948-20190620070948-00516.warc.gz | 889,245,800 | 31,132 | # What's the minimum number of straight cuts required to cut a pizza into 7 pieces of equal area?
91 views
Without taking the pizza out of the box or moving any part of it, what's the minimum number of straight cuts required to cut it into 7 pieces of equal area? A straight cut may start and end anywhere, and the pizza comes uncut and round in the box.
posted Jun 7, 2018
A vertical line to cut 1/7 of the pizza (on the left). Another vertical line to cut 2/7 of the pizza (on the right).
A vertical cut to divide the center piece in half.
At last a horizontal line passing thru the center of the pizza to divide in half the three pieces on the right.
or | 160 | 663 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.578125 | 3 | CC-MAIN-2019-26 | longest | en | 0.924478 |
https://www.studypool.com/questions/233696/show-that-n2-n-90-0 | 1,477,345,713,000,000,000 | text/html | crawl-data/CC-MAIN-2016-44/segments/1476988719784.62/warc/CC-MAIN-20161020183839-00217-ip-10-171-6-4.ec2.internal.warc.gz | 1,016,601,627 | 750,290 | # Show that n2 - n - 90 = 0
SoccerBoss
Category:
Mathematics
Price: \$5 USD
Question description
There are n sweets in a bag. 6 of the sweets are orange. The rest of the sweets are yellow.
Hannah takes a sweet from the bag at random and eats it.
Hannah then takes another sweet from the bag at random at eats that too.
The probability that Hannah eats two orange sweets is 1/3.
Show that n2 - n - 90 = 0
(Top Tutor) Daniel C.
(997)
School: UCLA
Studypool has helped 1,244,100 students
1822 tutors are online
### Related Mathematics questions
Brown University
1271 Tutors
California Institute of Technology
2131 Tutors
Carnegie Mellon University
982 Tutors
Columbia University
1256 Tutors
Dartmouth University
2113 Tutors
Emory University
2279 Tutors
Harvard University
599 Tutors
Massachusetts Institute of Technology
2319 Tutors
New York University
1645 Tutors
Notre Dam University
1911 Tutors
Oklahoma University
2122 Tutors
Pennsylvania State University
932 Tutors
Princeton University
1211 Tutors
Stanford University
983 Tutors
University of California
1282 Tutors
Oxford University
123 Tutors
Yale University
2325 Tutors | 309 | 1,169 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3 | 3 | CC-MAIN-2016-44 | longest | en | 0.760969 |
https://alokgoyal1971.com/ | 1,679,853,289,000,000,000 | text/html | crawl-data/CC-MAIN-2023-14/segments/1679296946445.46/warc/CC-MAIN-20230326173112-20230326203112-00501.warc.gz | 130,357,833 | 26,620 | ## Solution to Puzzle #200: Achieve Your GOAL
Friends, this is a bittersweet moment for me. This is the last post for some time, until I decide to pick up the threads again. Thanks to all of you for making this a wonderful journey for the last 5 years.
This was a simple puzzle and many of you sent me correct answers. Here are the first 5 to respond, each of whom have been sent an Amazon gift coupon.
Gourav Sharma – 6.45 pm Oct 29
Suman Saraf – 6.49 pm Oct 29
Deepak Kumar Singh – 6.56 pm Oct 29
Kartik Aggarwal – 11.38 pm Oct 29
Abdul Hakeem – 6.09 am Oct 30
I am copying the answer from one of the respondents. Thanks again to my daughter, Arushi Sharma Goyal, for contributing this puzzle.
Puzzle #200 Solution
Hope you all enjoyed the puzzle!
Posted in Solution | Tagged , | 1 Comment
## Solution to Puzzle #199: Two-Cube Calendar
This puzzle was originally posted in April 1969 by Martin Gardner, and is a classic even today. Thanks for an overwhelming response to the puzzle and my apologies for the delayed post as I was traveling on work outside the country over the last two weeks.
Many people sent correct answers – this includes Suman Saraf, Kumz91 (sorry do not know the full name), Naresh Kumra, Mohit Rana, Delhi Scrabble (again, do not know the real name), Gaurav Sharma, Viv423 (do not know the name again), Rishikant, G, Rowan an Pratik Poddar. And sorry, if I have missed out anyone. Well done all.
Please note that each cube must have 0, 1 and 2. This leaves only six faces for the 7 remaining digits. Trick is to realize that 6 and 9 can be on the same face and the cube can be turned around. On the right one, therefore, the three hidden faces will be 0, 1 and 2. On the left cube, one can see 1 and 2. The others will be 0, 6/9, 7 and 8.
Hope you all enjoyed the puzzle!
## Puzzle #200: Achieve your GOAL
Its been nearly 5 years since I started posting puzzles, and today is the 200th puzzle. I have thoroughly enjoyed posting puzzles, hearing from so many of you, especially some amazing children over the years. But its time for a break now – not sure if this is a few weeks or longer. So, enjoy the last puzzle – first 5 correct answers get a gift from my side!
This puzzle was given to be last week by my younger daughter, who got this in her class (grade V) in a math quiz. Its a simple puzzle, where you need to find your way from the entry to the GOAL without taking any left turn.
Puzzle #200: Find the way to the GOAL
As always, please send your answers as comments within the blog (preferred), or send an e-mail to alokgoyal_2001@yahoo.com. Please do share the puzzle with others if you like, and please also send puzzles that you have come across that you think I can share in this blog.
Happy solving!
Posted in Puzzles | Tagged , | 6 Comments
## Solution to Puzzle #198: The Neural Network Puzzle
This was a difficult puzzle, even though it was seemingly simple. I did get attempts from a few people, but the only correct answer came from Gaurav S (founder of d8i.ai) – thanks and well done Gaurav!
The site from where I took this puzzle had many correct answers, most of these were largely a bit of trial and error. One solution, which I modified a little, is as follows:
For each of the output node, if the desired input for firing is X, Y, Z (each of these being either a 0 or a 1), design the weights as:
• -1 if the input should be 0
• 1 if the input should have been 1
When you do this, you get an input output matrix as follows:
Puzzle #198 Solution
If we keep the threshold to be just below the thresholds mentioned in the table, you will get the desires output.
Hope you all enjoyed the solution!
## Puzzle #199: Two-Cube Calendar
Every time you pick up a Martin Gardner book, there is still always a wonderful puzzle that one has not seen. This one is an original Martin Gardner puzzle, i.e. this is his own creation, published in the book The Colossal Book of Short Puzzles and Problems.
Please look at the figure above. This is a desk calendar made out of two cubes that Martin Gardner saw at the Grand Central station in New York in a shop. Each day from 01-31 can be indicated by the two cubes so that their front faces give the required date. Each face can have a unique digit from 0 through 9. What are the four digits that cannot be seen on the left cube and the three that cannot be seen on the right cube?
As always, please send your answers as comments within the blog (preferred), or send an e-mail to alokgoyal_2001@yahoo.com. Please do share the puzzle with others if you like, and please also send puzzles that you have come across that you think I can share in this blog.
Happy dating!
Posted in Puzzles | Tagged , | 1 Comment
## Solution to Puzzle #197: 10 Friends
This was a relatively simple puzzle, and I got correct answers from Suman Saraf, Mohit Khare, Vishal Poddar and Pratik Poddar – thank you all!
An easy way to think about this is to create a 10 digit binary number, where each digit represents one of the friends each. 0 means the friend is not coming, and 1 means that the friend is coming. Note that there can be 2^10 combinations here, and each of them represents a distinct combination of friends coming.
Hope you all enjoyed the puzzle!
## Puzzle #198: The Neural Network Puzzle
Thanks to my INSEAD friend Sergio Werner for pointing me to a new source of puzzles and science articles – http://www.quantamagazine.org. I am reproducing a puzzle posted there by Pradeep Mutalik.
Neural networks and deep learning are the buzzwords of the day. Here is a puzzle that shows the basic mechanics of a neural network.
We’re going to create a simple network that converts binary numbers to decimal numbers. Imagine a network with just two layers — an input layer consisting of three units and an output layer with seven units. Each unit in the first layer connects to each unit in the second, as shown in the figure below.
As you can see, there are 21 connections. Every unit in the input layer, at a given point in time, is either off or on, having a value of 0 or 1. Every connection from the input layer to the output layer has an associated weight that, in artificial neural networks, is a real number between 0 and 1. Just to be contrary, and to make the network a touch more similar to an actual neural network, let us allow the weight to be a real number between –1 and 1 (the negative sign signifying an inhibitory neuron). The product of the input’s value and the connection’s weight is conveyed to an output unit as shown below. The output unit adds up all the numbers it gets from its connections to obtain a single number, as shown in the figure below using arbitrary input values and connection weights for a single output unit. Based on this number, the output number decides what its state is going to be. If it is more than a certain threshold, the unit’s value becomes 1, and if not, then its value becomes 0. We can call a unit that has a value of 1 a “firing” or “activated” unit and a unit with a value of 0 a “quiescent” unit.
Figure 2: Puzzle #198
Our three input units from top to bottom can have the values 001, 010, 011, 100, 101, 110 or 111, which readers may recognize as the binary numbers from 1 through 7.
Now the question: Is it possible to adjust the connection weights and the thresholds of the seven output units such that every binary number input results in the firing of only one appropriate output unit, with all the others being quiescent? The position of the activated output unit should reflect the binary input value. Thus, if the original input is 001, the leftmost output unit (or bottommost when viewed on a phone, as shown in the top figure) alone should fire, whereas if the original input is 101, the output unit that is fifth from the left (or from the bottom on a phone) alone should fire, and so on.
If you think the above result is not possible, try to adjust the weights to get as close as you can. Can you think of a simple adjustment, using additional connections but not additional units, that can improve your answer?
As always, please send your answers as comments within the blog (preferred), or send an e-mail to alokgoyal_2001@yahoo.com. Please do share the puzzle with others if you like, and please also send puzzles that you have come across that you think I can share in this blog.
Happy neuron-firing over the weekend!
## Solution to Puzzle #196: Bugs on a Board
Apologies for not posting anything in the last few weeks, was traveling on work or vacation through this period.
This was not a very difficult puzzle, but I got correct answers only from the two people who solve every puzzle – Pratik Poddar and Suman Saraf – thank you and well done!
(a) Color the board like a chessboard, i.e. alternate black and whites. Notice that a bug on a white square can only travel to a black and vice versa. Since there are a total of 81 squares, there will be one more white square (or one more black square). Hence when the bugs move, there will correspondingly be at least one empty white square (or black square).
(b) Bugs can change places pairwise. One can leave only the bug in the centre square or the corner, which will be the only empty square.
Hope you all enjoyed the puzzle!
## Puzzle #197: 10 Friends
This is a very common puzzle, many variants of which one would have. I still like it as the answer is very elegant, and teaches children a methodology. This one is from Mathematical Circles (Russian Experience) by Dmitri Fomin, Sergey Genkin and Ilia Itenberg.
A person has 10 friends. Over several days he invites some of them to a dinner party so that the company never repeats itself i.e. the exactly the same set of people cannot repeat itself on any of the days. He may, however, not invite anyone on one of the days. For how many days can he continue to invite people without repetition?
As always, please send your answers as comments within the blog (preferred), or send an e-mail to alokgoyal_2001@yahoo.com. Please do share the puzzle with others if you like, and please also send puzzles that you have come across that you think I can share in this blog.
Happy partying…and there will be a lot of it!
Posted in Puzzles | | 3 Comments
## Solution to Puzzle #195: 1989!
I received many correct answers. These included Suman Saraf, Vishal Poddar and Anand Sanghi. Thank you and well done!
This puzzle can be solved using the concept of “invariants” and parity.
Note that for any numbers a and b (a > b), numbers a and b get replaced by c. If a and b are both odd or both even, then c will be even. If one of them is odd and the other is even, then c will be odd. Essentially, in all the cases, if (a+b) is odd, c will be odd; If (a+b) is even, then c will be even. Therefore, parity of a+b is an invariant.
For the final set of numbers to be zero (which is even parity), the sum of all the numbers must be even, i.e. 1, 2, 3, …., 1989 must add up to an even number, which is not the case. Hence we can never achieve zeros as the final state.
Hope you all enjoyed the puzzle! | 2,682 | 11,099 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.578125 | 4 | CC-MAIN-2023-14 | longest | en | 0.937102 |
https://dieklugeeule.com/if-an-object-has-a-mass-of-50-kg-what-is-its-weight/ | 1,603,502,302,000,000,000 | text/html | crawl-data/CC-MAIN-2020-45/segments/1603107881551.11/warc/CC-MAIN-20201023234043-20201024024043-00032.warc.gz | 280,884,582 | 8,804 | # If an object has a mass of 50 kg, what is its weight?
#### Antworten:
Well, it depends...
#### Erläuterung:
Weight is given by the formula,
W=mg
• W is the weight of the object in newtons
• m is the mass of the object in kilograms
• g is the gravitational acceleration
On Earth, g=9.8 "m/s"^2. So, the object's weight on Earth will be:
W=50 "kg"*9.8 "m/s"^2
=490 "N"
Can you tell what the object's weight will be on another planet, such as Mars? | 136 | 459 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.40625 | 3 | CC-MAIN-2020-45 | latest | en | 0.890997 |
https://fr.mathworks.com/help/matlab/ref/xlim.html | 1,716,037,318,000,000,000 | text/html | crawl-data/CC-MAIN-2024-22/segments/1715971057422.43/warc/CC-MAIN-20240518121005-20240518151005-00829.warc.gz | 230,829,734 | 24,844 | Main Content
# xlim
Set or query x-axis limits
## Syntax
``xlim(limits)``
``xlim(limitmethod)``
``xlim(limitmode)``
``xl = xlim``
``limmethod = xlim("method")``
``limmode = xlim("mode")``
``___ = xlim(target,___)``
## Description
### Specify Limits
example
````xlim(limits)` sets the x-axis limits for the current axes or chart. Specify `limits` as a two-element vector of the form `[xmin xmax]`, where `xmax` is greater than `xmin`.```
example
````xlim(limitmethod)` specifies the limit method MATLAB® uses for automatic limit selection. Specify the limit method as `"tickaligned"`, `"tight"`, or `"padded"`. MATLAB sets the `XLimitMethod` property of the axes to the value you specify. The limit method is not supported for standalone visualizations.You can specify the `limitmethod` argument without parentheses. For example, `xlim tight` enables tight x-axis limits.```
example
````xlim(limitmode)` specifies automatic or manual limit selection. The `limitmode` can have either of two values: `"auto"` — Enable automatic limit selection. MATLAB selects the limits based on the range of your data and the value of the `XLimitMethod` property of the axes. If you plot into the axes multiple times, the limits update to encompass all the data.`"manual"` — Freeze the x-axis limits at their current value. You can specify the `limitmode` argument without parentheses. For example, `xlim auto` enables automatic limit selection.```
### Query Limits
example
````xl = xlim` returns the current limits as a two-element vector.```
````limmethod = xlim("method")` returns the current x-axis limits method, which can be `'tickaligned'`, `'tight'`, or `'padded'`.```
````limmode = xlim("mode")` returns the current x-axis limits mode, which is either `'auto'` or `'manual'`. By default, the mode is automatic unless you specify limits or set the mode to manual.```
### Specify Target Axes or Chart
example
````___ = xlim(target,___)` uses the axes or standalone visualization specified by `target` instead of the current axes. Specify `target` as the first input argument for any of the previous syntaxes. You can include an output argument if the original syntax supports an output argument. Use quotes around the mode inputs, for example, `xlim(target,"auto")`.```
## Examples
collapse all
Plot a line and set the x-axis limits to range from 0 to 5.
```x = linspace(0,10); y = sin(x); plot(x,y) xlim([0 5])```
Create a surface plot and show only x values greater than 0. Specify the minimum x-axis limit as 0 and let MATLAB choose the maximum limit.
```[X,Y,Z] = peaks; surf(X,Y,Z) xlim([0 inf])```
Create a stem chart with dates along the x-axis. Set the x-axis limits to range from June 1, 2014 to June 5, 2014.
```t = datetime(2014,06,1) + caldays(0:10); y = rand(11,1); stem(t,y,'filled') tstart = datetime(2014,06,1); tend = datetime(2014,06,5); xlim([tstart tend])```
If you want the x-axis to automatically adjust to match the range of your x-coordinates, use the `'tight'` limit method.
Create a line plot.
`plot([1 2 3 4 5 6.3],[0 0.3 0.1 0.6 0.4 1])`
Change the limit method to `'tight'`.
`xlim tight`
Add another plot to the axes. The x-axis limits adjust to encompass the span of the new data.
```hold on plot([1 2 3 4 5 8.3],[0.1 0.2 0.3 0.4 0.5 0.83]) hold off```
Starting in R2019b, you can display a tiling of plots using the `tiledlayout` and `nexttile` functions. Call the `tiledlayout` function to create a 2-by-1 tiled chart layout. Call the `nexttile` function to create the axes objects `ax1` and `ax2`. Plot data into each axes. Then set the x-axis limits for the bottom plot by specifying `ax2` as the first input argument to `xlim`.
```tiledlayout(2,1) x = linspace(0,5,1000); y = sin(100*x)./exp(x); ax1 = nexttile; plot(ax1,x,y) ax2 = nexttile; plot(ax2,x,y) xlim(ax2,[0 1])```
Use manual mode to maintain the current x-axis limits when you add more plots to the axes.
First, plot a line.
```x = linspace(0,10); y = sin(x); plot(x,y);```
Set the x-axis limits mode to manual so that the limits do not change. Use `hold on` to add a second plot to the axes.
```xlim manual hold on plot(2*x,2*y) hold off```
The x-axis limits do not update to incorporate the new plot.
Switch back to automatically updated limits by resetting the mode to automatic.
`xlim auto`
Create a scatter plot of random data. Return the values of the x-axis limits.
```x = randn(50,1); y = randn(50,1); scatter(x,y)```
`xl = xlim`
```xl = 1×2 -3 4 ```
## Input Arguments
collapse all
Minimum and maximum limits, specified as a two-element vector of the form `[xmin xmax]`, where `xmax` is greater than `xmin`. You can specify the limits as numeric, categorical, datetime, or duration values. However, the type of values that you specify must match the type of values along the x-axis.
You can specify both limits, or specify one limit and let MATLAB automatically calculate the other. For an automatically calculated minimum or maximum limit, use `-inf` or `inf`, respectively. MATLAB uses the `"tight"` limit method to calculate the corresponding limit.
Example: `xlim([0 1])`
Example: `xlim([-inf 1])`
Example: `xlim([0 inf])`
Data Types: `single` | `double` | `int8` | `int16` | `int32` | `int64` | `uint8` | `uint16` | `uint32` | `uint64` | `categorical` | `datetime` | `duration`
Limit selection method, specified as a value from the table.
The examples in the table show the approximate appearance for each method. Your results might differ depending on your data, the size of the axes, and the type of plot you create.
ValueDescriptionExample
`"tickaligned"`
In general, align the edges of the axes box with the tick marks that are closest to your data without excluding any data. The appearance might vary depending on the type of data you plot and the type of chart you create.
`"tight"`
Fit the axes box tightly around the data by setting the axis limits to the data range.
`"padded"`
Fit the axes box around the data with a thin margin of padding on each side. The width of the margin is approximately 7% of the data range.
Note
• The limit method has no effect when the `XLimMode` property of the axes is set to `"manual"`.
• Specifying the limit method is not supported for standalone visualizations such as `heatmap` or `stackedplot`.
Limit mode, specified as one of the following values:
• `"auto"` — Enable automatic limit selection, which is based on the total span of the data and the value of the `XLimitMethod` property of the axes. If you plot into the axes multiple times, the limits update to encompass all the data. You can use this option if you change the limits and want to set them back to the default values.
• `"manual"` — Freeze the limits at the current values. Use this option if you want to retain the current limits when adding new data to the axes using the ```hold on``` command.
When you specify this argument, MATLAB sets the `XLimMode` property of the axes to the value you specify. However, the `XLimMode` property changes to `"manual"` whenever you set the x-axis limits explicitly, either by calling `xlim(limits)`, or by setting the value of the `XLim` property on the axes.
Target axes or chart, specified as one of the following:
If you do not specify this argument, then `xlim` sets the limits on the graphics object returned by the `gca` command.
## Output Arguments
collapse all
Current limits, returned as a two-element vector of the form ```[xmin xmax]```.
Querying the limits returns the `XLim` or `XLimits` property value for corresponding `Axes` or graphics object.
Current limits method, returned as one of these values:
• `'tickaligned'` — In general, align the edges of the axes box with the tick marks that are closest to your data without excluding any data. The appearance might vary depending on the type of data you plot and the type of chart you create.
• `'tight'` — Fit the axes box tightly around the data by setting the axis limits to the data range.
• `'padded'` — Fit the axes box around the data with a thin margin of padding on each side. The width of the margin is approximately 7% of the data range.
Querying the x-axis limits method returns the `XLimitMethod` property value for the corresponding `Axes` object.
Current limits mode, returned as one of these values:
• `'auto'` — Automatically determine the limits.
• `'manual'` — Use manually specified limits that do not update to reflect changes in the data.
Querying the x-axis limits mode returns the `XLimMode` property value for the corresponding `Axes` object.
## Algorithms
The `xlim` function sets and queries several axes properties related to the x-axis limits.
• `XLim` — Property that stores the x-axis limits.
• `XLimMode` — Property that stores the x-axis limits mode. When you set the x-axis limits, this property changes to `"manual"`.
• `XLimitMethod` — Property that controls how the x-axis limits are calculated when the `XLimMode` property is set to `"auto"`.
## Version History
Introduced before R2006a
expand all | 2,282 | 9,043 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.578125 | 3 | CC-MAIN-2024-22 | latest | en | 0.480587 |
https://unlearningmath.com/2010/08/14/operators-functions-and-properties-part-21/ | 1,642,972,976,000,000,000 | text/html | crawl-data/CC-MAIN-2022-05/segments/1642320304309.59/warc/CC-MAIN-20220123202547-20220123232547-00576.warc.gz | 556,454,582 | 30,444 | ## Operators, Functions, and Properties – part 21
In this series we’ve been looking at operators, which we have visualized as boxes with a value (or multiple values) going in, and a single value coming out. We pictured these boxes as little machines, which sit there waiting for values to be put on their inputs so that they can then produce a value on their output. The work of producing these values on the output may involve calculation, or look-up, or other logic; what is key is that the inputs provide everything that is needed to determine the output. Such operators can be combined with other operators, by connecting the output of one to the input of another. Through such operators we can investigate and understand many of the key ideas of algebra but using a very different (and for sixth and seventh graders, a more natural) system of notation.
Lately, we have been playing with such operators to model the workings of a simple four-function calculator and seeing if the concepts and notations we’ve introduced are powerful enough for something like that. In the last post, we showed some look-up operators. I’d like to show another notation for the look-up operator, one which makes it look like a switch.
The box shown has four inputs: a, b, c and s; and one output: o. The box selects one of a, b, or c to be connected through to o, and which one is picked depends on the value of s. The labels shown in the box, at the end of the lines for a, b, c indicate the values that s is compared against. If s has the value “fri”, then a is connected through to o; if s has the value “sat”, then b is connected through to o; if s has any other value (“else”) then c is connected through to o. The effect is that s chooses one of a, b, and c. Though on the surface, this box may look different from our look-up table in the prior post, it is equivalent to it. Also, it is not essential that this box have four inputs, it could have any number of inputs on the left, one of which is to be connected through to the output based on the switch value s.
We’re now ready to take another look at the four-function calculator, and model its states and operators.
The logic that drives the calculator screen is now ready to be shown in its final form:
where the blue line indicates, as before, the state of the machine; the value on the right is the value that is to be shown on the calculator’s screen.
In the diagram above, we are looking at what happens when the “=” is pressed. Depending on what operation symbol was pressed before, “+”, “-“, “×” or “÷”, something needs to happen with the two numbers that have been collected (in the .LeftValue and .RightValue components of the state, respectively), based on the value of the PendingOp component of the state. The green box on the right is the box we want to build, taking a left value and a right value and a value for the pending operator, and producing a single value, which is the result of the operation we are supposed to perform. The diagram on the left is the contents of the green box, is one way that the green box could have been built based on the values coming in. Basically, we have the left value L and the right value L being combined as addition, subtraction, multiplication, and division, and then one of those values is selected based on the value of op.
Designing the green box is likely to be fruitful, because we can anticipate that the actions in the green box aren’t taken only when the “=” is pressed: something similar clearly happens when you press “+” the second time in “4+7+5=” and in other cases where the four functions are repeated, even without ever pressing “=”.
We’ll expand on this idea in the next post.
This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink. | 855 | 3,809 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.28125 | 4 | CC-MAIN-2022-05 | latest | en | 0.93928 |
https://www.gradesaver.com/textbooks/math/other-math/CLONE-547b8018-14a8-4d02-afd6-6bc35a0864ed/chapter-5-ratio-and-proportion-test-page-375/8 | 1,726,321,654,000,000,000 | text/html | crawl-data/CC-MAIN-2024-38/segments/1725700651579.38/warc/CC-MAIN-20240914125424-20240914155424-00704.warc.gz | 726,628,117 | 12,327 | ## Basic College Mathematics (10th Edition)
The ratio of your income last year to your income this year is 3 to 2. i.e. $\frac{Last Yr. Income}{This Yr. Income} = \frac{3}{2}$ It means that your income last year was higher then income this year. Example You earned Dollar 30000 last year. and You earned Dollar 20000 this year.
The ratio of your income last year to your income this year is 3 to 2. i.e. $\frac{Last Yr. Income}{This Yr. Income} = \frac{3}{2}$ It means that your income last year was higher then income this year. For Example You earned Dollar 30000 last year. and You earned Dollar 20000 this year. It means that you earned more last year then this year. Now, If we find the ratio of your income last year to your income this year. i.e. $\frac{Last Yr. Income}{This Yr. Income} = \frac{30000 Dollar}{20000 Dollar}$ = $\frac{30000}{20000}$ (As common unit) = $\frac{30000 \div 10000}{20000 \div 10000}$ = $\frac{3}{2}$ | 272 | 935 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.15625 | 4 | CC-MAIN-2024-38 | latest | en | 0.885327 |
https://minuteshours.com/57-hours-and-23-minutes-to-seconds | 1,713,380,366,000,000,000 | text/html | crawl-data/CC-MAIN-2024-18/segments/1712296817171.53/warc/CC-MAIN-20240417173445-20240417203445-00160.warc.gz | 346,375,655 | 6,232 | # 57 hours and 23 minutes in seconds
## Result
57 hours 23 minutes equals 206580 seconds
## How to convert 57 hours 23 minutes to seconds?
In order to convert 57 hours and 23 minutes to seconds we need to take each part of hours and minutes and transform them into seconds. We know that 1 hour equals 3600 seconds. Therefore to get the number of hours in seconds we need to multiply the amount of hours by 3600. In this case we have to multiply 57 hours by 3600:
57h × 3600s = 205200 seconds
We also know that 1 minute equals 60 seconds. Therefore to get the number of minutes in seconds we need to multiply the amount of minutes by 60. In this case we have to multiply 23 minutes by 60:
23m × 60s = 1380 seconds
Now we have to add both amount of seconds to get the final result:
205200s + 1380s = 206580 seconds
Finally we can say that 57 hr 23 min is equivalent to 206580 seconds:
57 hours and 23 minutes = 206580 seconds
Fifty-seven hours and twenty-three minutes is equal to two hundred six thousand five hundred eighty seconds.
You can also convert 57 hours and 23 minutes to minutes and 57 hours and 23 minutes to hours.
## Conversion table
For quick reference purposes, below is the hours and minutes to seconds conversion table:
hours(h) minutes(m) seconds(s)
58 hours 23 minutes 210180 seconds
59 hours 23 minutes 213780 seconds
60 hours 23 minutes 217380 seconds
61 hours 23 minutes 220980 seconds
62 hours 23 minutes 224580 seconds
63 hours 23 minutes 228180 seconds
64 hours 23 minutes 231780 seconds
65 hours 23 minutes 235380 seconds
66 hours 23 minutes 238980 seconds
67 hours 23 minutes 242580 seconds
## Units definitions
The units involved in this conversion are hours, minutes and seconds. This is how they are defined:
### Hours
An hour (symbol: h, also abbreviated hr) is a unit of time conventionally reckoned as 1⁄24 of a day and scientifically reckoned between 3,599 and 3,601 seconds. In the modern metric system, hours are an accepted unit of time defined as 3,600 atomic seconds. There are 60 minutes in an hour, and 24 hours in a day.
### Minutes
The minute is a unit of time usually equal to 1⁄60 (the first sexagesimal fraction) of an hour, or 60 seconds. In the UTC time standard, a minute on rare occasions has 61 seconds, a consequence of leap seconds (there is a provision to insert a negative leap second, which would result in a 59-second minute, but this has never happened in more than 40 years under this system). Although not an SI unit, the minute is accepted for use with SI units. The SI symbol for minute or minutes is min (without a dot).
### Seconds
The second (symbol: s, also abbreviated: sec) is the unit of time in the International System of Units (SI), historically defined as 1⁄86400 of a day – this factor derived from the division of the day first into 24 hours, then to 60 minutes and finally to 60 seconds each (24 × 60 × 60 = 86400). | 738 | 2,915 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.21875 | 4 | CC-MAIN-2024-18 | latest | en | 0.878087 |
http://bestfx.com/office-tutorials/excel-tutorials/math-trig-functions/ceiling-function.html | 1,519,573,683,000,000,000 | text/html | crawl-data/CC-MAIN-2018-09/segments/1518891816647.80/warc/CC-MAIN-20180225150214-20180225170214-00715.warc.gz | 41,375,123 | 30,108 | Related Functions:
The CEILING function returns number rounded up, away from zero, to the nearest multiple of significance.
Syntax
=CEILING(number,significance)
Arguments
Argument Description
number The value you want to round
significance The multiple to which you want to round
Note: In Excel 2003 & 2007, the significance argument must have the same arithmetic sign, positive or negative, as the number argument. However, in later versions of Excel, the CEILING function has been improved, so that it can now handle a negative number argument and a positive significance argument. In this case, the CEILING function reverses the direction of the rounding, i.e. rounds the supplied number towards zero.
Examples
A B C
1 Formula Result Notes
2 =CEILING(2.5,1) 3 Rounds 2.5 up to nearest multiple of 1
3 =CEILING(-2.5,-2) -4 Rounds -2.5 up to nearest multiple of -2
4 =CEILING(-2.5,2) -2 Rounds -2.5 up to nearest multiple of 2
5 =CEILING(0.234,0.01) 0.24 Rounds 0.234 up to the nearest multiple of 0.01
Usage note: If you want to avoid using pennies in your prices and your product is priced at \$4.42, use the formula =CEILING(4.42,0.05) to round prices up to the nearest nickel.
Common Function Error(s)
Problem What went wrong
#VALUE! Occurs if either of the supplied arguments is non-numeric
#NUM! Occurs if either:
• In Excel 2010 orExcel 2013: – if the supplied number is positive and the supplied significance is negative • In Excel 2007 orearlier: – if the supplied significance value has a different arithmetic sign to the supplied number argument
#DIV/0! Occurs if the supplied significance argument = 0 | 449 | 1,627 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.578125 | 4 | CC-MAIN-2018-09 | latest | en | 0.707549 |
https://www.craftsy.com/post/complementary-colors-vs-analogous-colors/ | 1,600,603,252,000,000,000 | text/html | crawl-data/CC-MAIN-2020-40/segments/1600400197946.27/warc/CC-MAIN-20200920094130-20200920124130-00415.warc.gz | 831,437,254 | 26,863 | # Color Theory In Painting: Analogous, Triadic and Complementary Colors Schemes
Color is known to affect our moods and emotions, so it makes sense to rely on color as a key element in your painting for conveying meaning or depicting an atmosphere. But color selection is an important process. You want the colors you are using to work well together, and it can be confusing at first to know how many colors to use and which ones work together. Understanding color theory is an excellent way to simplify those decisions, and I’m here to help you by breaking down the basics of color theory in painting.
Photo via the Craftsy class Master Palettes: Exploring Color Mixing
## A word about the color wheel
The first color wheel was made by Isaac Newton in the 17th century. Using a prism to decompose white sunlight into the colors of the spectrum, he then joined the two ends of the spectrum to form the wheel.
The color wheel used by artists today is the RYB color wheel (red, yellow and blue). It is a subtractive color wheel, which means that colors become darker when mixed. With an additive color wheel, colors made by a light source would get lighter as you mix them. The best example of this is on a computer screen.
Depending on the complexity of the color wheel, you will find a different number of colors. However, the simplest color wheels have 12 colors:
• The three primaries: That means colors that can’t be obtained by mixing other colors, all other colors on the wheel can be mixed from these three primaries.
• The three secondary colors: These are obtained by mixing two of the primary colors
• The six tertiary colors: Such colors are obtained by mixing two secondary colors contiguous on the wheel. That is, a tertiary color is obtained by mixing two secondary colors or one primary and one secondary color.
RYB color wheel via Wikimedia commons
## How to use the color wheel to select a beautiful and harmonious palette.
There are many combinations of colors or color schemes that will work for your painting. Here are three simple ways to find some of them by using the color wheel:
### Analogous color scheme
Analogous colors are three or more colors that are next to each other on the color wheel, like the circles in the picture below. Using this type of color scheme makes the painting look harmonious, but the actual feeling conveyed will depend on the colors you chose based mostly on their temperature: warm colors versus cold colors.
Analogous color scheme via Wikimedia commons
In that scheme, one color is usually predominant, and it is usually the color in the center of the scheme. In the example below, light green would most likely be the predominant color, but there are also yellow and blue hues in the painting.
Green Bouquet via Sandrine Pelissier
This still life has an analogous color scheme with hues of yellow, blue and green.
A triadic color scheme will include three colors from the color wheel that are equally spaced to form a triangle, or if you are using a 12 color wheel, the scheme would be comprised by selecting every fourth color on the wheel.
These are the four combinations of triadic colors you can get with a 12 colors color-wheel. You can get more combinations with a more complex color wheel.
When working with a triadic color scheme, usually one of the three colors is the dominant color. The other two will be used for contrasting accents.
You can mix a range of colors from the three colors you selected. Mixing the three colors together will give you interesting hues of brown.
Blooming Peony by Sandrine Pelissier
This painting is an example of a triadic color scheme.
### Complementary color scheme
Complementary colors are colors that are located across each other on the color wheel. For example red-green, blue-orange, and purple-yellow.
Complementary color scheme yellow-purple: The two colors are located across each other on the color wheel.
When a painting is made using a complementary color scheme, the result is usually very vibrant and high-contrast. As in the other color schemes, you will get better results if one of the colors is dominant while the other is used as an accent.
Ferry dock by Sandrine Pelissier
This painting uses hues of blue as the main “dominant” color with a mix yellow-orange accents.
Color theory is only the beginning! You can learn to utilize color like a master in the Craftsy class Painting With Color: A Contemporary Approach, as you begin to use color to expresses form, value and dimension in captivating ways! | 939 | 4,545 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.875 | 3 | CC-MAIN-2020-40 | longest | en | 0.947471 |
http://slideshowes.com/doc/185509/sl1---maastricht-university | 1,493,606,743,000,000,000 | text/html | crawl-data/CC-MAIN-2017-17/segments/1492917126538.54/warc/CC-MAIN-20170423031206-00615-ip-10-145-167-34.ec2.internal.warc.gz | 351,347,024 | 16,202 | ```Decision-Tree Induction &
Decision-Rule Induction
Evgueni Smirnov
Overview
1.
2.
3.
4.
5.
6.
Instances, Concepts, Languages
Decision Trees
Decision Rules
Evaluation Techniques
Intro to Weka
Instances, Concepts, Languages
A concept is a set of objects in a world that are unified by a reason.
A reason may be a similar appearance, structure or function.
friendly robots
Example. The set: {children, photos, cat, diplomas} can be
viewed as a concept “Most important things to take out of your
apartment when it catches fire”.
Instances, Concepts, Languages
Li
body = round
smiling = yes
holding = flag
color = yellow
friendly robots
Instances, Concepts, Languages
smiling = yes
friendly robots
Lc
M
Li
body = round
smiling = yes
holding = flag
color = yellow
friendly robots
<Li, Lc, M, <I+, I->>
Lc
M
Li
I +:
I-:
<Li, Lc, M, I>
Lc
M
Li
<Li, Lc, M, I>
Lc
M
Li
Decision Trees
•
•
•
•
•
•
•
Decision trees
Appropriate problems for decision trees
Entropy and Information Gain
The ID3 algorithm
Avoiding Overfitting via Pruning
Handling Continuous-Valued Attributes
Handling Missing Attribute Values
Decision Trees
Definition: A decision tree is a tree s.t.:
• Each internal node tests an attribute
• Each branch corresponds to attribute value
• Each leaf node assigns a classification
Outlook
Sunny
Overcast
Rainy
Humidity
yes
Windy
High
Normal
False
True
no
yes
yes
no
Data Set for Playing Tennis
Outlook
Temp.
Humidity
Windy
Play
Outlook
Temp.
Humidity
Windy
play
Sunny
Hot
High
False
no
Sunny
Mild
High
False
no
Sunny
Hot
High
True
no
Sunny
Cool
Normal
False
yes
Overcast
Hot
High
False
yes
Rainy
Mild
Normal
False
yes
Rainy
Mild
High
False
yes
Sunny
Mild
Normal
True
yes
Rainy
Cool
Normal
False
yes
Overcast
Mild
High
True
yes
Rainy
Cool
Normal
True
no
Overcast
Hot
Normal
False
yes
Overcast
Cool
Normal
True
yes
Rainy
Mild
High
True
no
Decision Tree For Playing Tennis
Outlook
Sunny
Overcast
Rainy
Humidity
yes
Windy
High
Normal
False
True
no
yes
yes
no
When to Consider Decision Trees
• Each instance consists of an attribute with discrete values
(e.g. outlook/sunny, etc..)
• The classification is over discrete values (e.g. yes/no )
• It is okay to have disjunctive descriptions – each path in
the tree represents a disjunction of attribute combinations.
Any Boolean function can be represented!
• It is okay for the training data to contain errors – decision
trees are robust to classification errors in the training data.
• It is okay for the training data to contain missing values –
decision trees can be used even if instances have missing
attributes.
Rules in Decision Trees
Outlook
Sunny
Overcast
Rainy
Humidity
yes
Windy
High
Normal
False
True
no
yes
yes
no
If Outlook = Sunny & Humidity = High then Play = no
If Outlook = Sunny & Humidity = Normal then Play = yes
If Outlook = Overcast then Play = yes
If Outlook = Rainy & Windy = False then Play = yes
If Outlook = Rainy & Windy = True then Play = no
Decision Tree Induction
Basic Algorithm:
1. A the “best" decision attribute for a node N.
2. Assign A as decision attribute for the node N.
3. For each value of A, create new descendant of the node N.
4. Sort training examples to leaf nodes.
5. IF training examples perfectly classified, THEN STOP.
ELSE iterate over new leaf nodes
Decision Tree Induction
Outlook
Sunny
Rain
Overcast
____________________________________
Outlook Temp Hum Wind Play
------------------------------------------------------Sunny
Hot
High Weak no
Sunny
Hot
High Strong no
Sunny
Mild
High Weak no
Sunny
Cool
Normal Weak yes
Sunny
Mild
Normal Strong yes
_____________________________________
Outlook
Temp Hum Wind Play
--------------------------------------------------------Overcast
Hot
High
Weak yes
Overcast
Cool Normal Strong yes
_____________________________________
Outlook
Temp Hum Wind Play
--------------------------------------------------------Rain
Mild
High
Weak yes
Rain
Cool
Normal Weak yes
Rain
Cool
Normal Strong no
Rain
Mild
Normal Weak yes
Rain
Mild
High
Strong no
Entropy
Let S be a sample of training examples, and
p+ is the proportion of positive examples in S
and
p- is the proportion of negative examples in S.
Then: entropy measures the impurity of S:
E( S) = - p+ log2 p+ – p- log2 p-
Entropy Example from the Dataset
Outlook
Temp.
Humidity
Windy
Play
Outlook
Temp.
Humidity
Windy
play
Sunny
Hot
High
False
no
Sunny
Mild
High
False
no
Sunny
Hot
High
True
no
Sunny
Cool
Normal
False
yes
Overcast
Hot
High
False
yes
Rainy
Mild
Normal
False
yes
Rainy
Mild
High
False
yes
Sunny
Mild
Normal
True
yes
Rainy
Cool
Normal
False
yes
Overcast
Mild
High
True
yes
Rainy
Cool
Normal
True
no
Overcast
Hot
Normal
False
yes
Overcast
Cool
Normal
True
yes
Rainy
Mild
High
True
no
p yes
9
14
log
2
9
14
0.41
5
5
log 2 0.53
14
14
p no
E ( S ) p yes p no 0.94
Information Gain
Information Gain is the expected reduction in entropy
caused by partitioning the instances according to a given
attribute.
Gain(S, A) = E(S) -
vValues ( A )
| Sv |
|S |
E (Sv )
where Sv = { s S | A(s) = v}
S
Sv1 = { s S | A(s) = v1}
Sv12 = { s S | A(s) = v2}
Example
Outlook
Sunny
Rain
Overcast
____________________________________
Outlook Temp Hum Wind Play
------------------------------------------------------Sunny
Hot
High False
No
Sunny
Hot
High True
No
Sunny
Mild
High False No
Sunny
Cool
Normal False Yes
Sunny
Mild
Normal True Yes
_____________________________________
Outlook
Temp Hum Wind Play
--------------------------------------------------------Overcast
Hot
High
Weak Yes
Overcast
Cool Normal Strong Yes
_____________________________________
Outlook
Temp Hum Windy Play
--------------------------------------------------------Rain
Mild
High
False Yes
Rain
Cool
Normal False Yes
Rain
Cool
Normal True
No
Rain
Mild
Normal False Yes
Rain
Mild
High
True
No
Which attribute should be tested here?
Gain (Ssunny , Humidity) = = .970 - (3/5) 0.0 - (2/5) 0.0 = .970
Gain (Ssunny , Temperature) = .970 - (2/5) 0.0 - (2/5) 1.0 - (1/5) 0.0 = .570
Gain (Ssunny , Wind) = .970 - (2/5) 1.0 - (3/5) .918 = .019
ID3 Algorithm
Informally:
– Determine the attribute with the highest
information gain on the training set.
– Use this attribute as the root, create a branch for
each of the values the attribute can have.
– For each branch, repeat the process with subset
of the training set that is classified by that
branch.
Hypothesis Space Search in ID3
• The hypothesis space is the
set of all decision trees
defined over the given set of
attributes.
• ID3’s hypothesis space is a
compete space; i.e., the target
description is there!
• ID3 performs a simple-tocomplex, hill climbing search
through this space.
Hypothesis Space Search in ID3
• The evaluation function is
the information gain.
• ID3 maintains only a single
current decision tree.
• ID3
performs
no
backtracking in its search.
• ID3 uses all training
instances at each step of the
search.
Overfitting
Definition: Given a hypothesis space H, a hypothesis h
H is said to overfit the training data if there exists
some hypothesis h’ H, such that h has smaller error
that h’ over the training instances, but h’ has a smaller
error that h over the entire distribution of instances.
Reasons for Overfitting
Outlook
sunny
overcast
rainy
Humidity
yes
Windy
high
normal
false
true
no
yes
yes
no
• Noisy training instances. Consider an noisy training example:
Outlook = Sunny; Temp = Hot; Humidity = Normal; Wind = True; PlayTennis = No
This instance affects the training instances:
Outlook = Sunny; Temp = Cool; Humidity = Normal; Wind = False; PlayTennis = Yes
Outlook = Sunny; Temp = Mild; Humidity = Normal; Wind = True; PlayTennis = Yes
Reasons for Overfitting
Outlook
sunny
overcast
rainy
Humidity
yes
Windy
high
normal
false
true
no
Windy
yes
no
false
true
yes
Temp
mild
yes
cool
?
Outlook = Sunny; Temp = Hot; Humidity = Normal; Wind = True; PlayTennis = No
Outlook = Sunny; Temp = Cool; Humidity = Normal; Wind = False; PlayTennis = Yes
Outlook = Sunny; Temp = Mild; Humidity = Normal; Wind = True; PlayTennis = Yes
high
no
Reasons for Overfitting
• Small number of instances are associated with leaf nodes. In
this case it is possible that for coincidental regularities to occur
that are unrelated to the actual target concept.
-
+ + +
+
+ ++
-
-
area with probably
wrong predictions
- +
-
-
-
- -
-
-
Approaches to Avoiding Overfitting
• Pre-pruning: stop growing the tree earlier,
before it reaches the point where it perfectly
classifies the training data
• Post-pruning: Allow the tree to overfit the
data, and then post-prune the tree.
Validation Set
• Validation set is a set of instances used to evaluate the utility
of nodes in decision trees. The validation set has to be chosen
so that it is unlikely to suffer from same errors or fluctuations
as the training set.
• Usually before pruning the training data is split randomly into
a growing set and a validation set.
Reduced-Error Pruning
Split data into
validation sets.
growing
and
Pruning a decision node d consists of:
1. removing the subtree rooted at d.
2. making d a leaf node.
3. assigning d the most common
classification of the training
instances associated with d.
Outlook
sunny
overcast
rainy
Humidity
yes
Windy
high
normal
false
true
no
yes
yes
no
3 instances
2 instances
Accuracy of the tree on the validation
set is 90%.
Reduced-Error Pruning
Split data into
validation sets.
growing
and
Pruning a decision node d consists of:
1. removing the subtree rooted at d.
2. making d a leaf node.
3. assigning d the most common
classification of the training
instances associated with d.
Outlook
sunny
overcast
rainy
no
yes
Windy
false
true
yes
no
Accuracy of the tree on the validation
set is 92.4%.
Reduced-Error Pruning
Split data into
validation sets.
growing
and
Pruning a decision node d consists of:
1. removing the subtree rooted at d.
2. making d a leaf node.
3. assigning d the most common
classification of the training
instances associated with d.
Do until further pruning is harmful:
1. Evaluate impact on validation set
of pruning each possible node
(plus those below it).
2. Greedily remove the one that most
improves validation set accuracy.
Outlook
sunny
overcast
rainy
no
yes
Windy
false
true
yes
no
Accuracy of the tree on the validation
set is 92.4%.
Reduced Error Pruning Example
Rule Post-Pruning
1. Convert tree to equivalent set of rules.
2. Prune each rule independently of others.
3. Sort final rules by their estimated accuracy, and consider them
in this sequence when classifying subsequent instances.
Outlook
no
sunny
overcast
rainy
Humidity
yes
Windy
IF (Outlook = Sunny) & (Humidity = High)
THEN PlayTennis = No
IF (Outlook = Sunny) & (Humidity = Normal)
THEN PlayTennis = Yes
……….
normal
false
true
yes
yes
no
Continuous Valued Attributes
1. Create a set of discrete attributes to test continuous.
2. Apply Information Gain in order to choose the best
attribute.
Temperature:
PlayTennis:
40
No
48
No
60
Yes
Temp>54
72
Yes
80
Yes
90
No
Tem>85
Missing Attribute Values
Strategies:
1. Assign most common value of A among other instances
belonging to the same concept.
2. If node n tests the attribute A, assign most common value
of A among other instances sorted to node n.
3. If node n tests the attribute A, assign a probability to each
of possible values of A. These probabilities are estimated
based on the observed frequencies of the values of A. These
probabilities are used in the information gain measure (via
entropy). (E( S) = - p+ log2 p+ – p- log2 p-)
Summary Points
1. Decision tree learning provides a practical method for
concept learning.
2. ID3-like algorithms search complete hypothesis space.
3. The inductive bias of decision trees is preference (search)
bias.
4. Overfitting the training data is an important issue in
decision tree learning.
5. A large number of extensions of the ID3 algorithm have
been proposed for overfitting avoidance, handling missing
attributes, handling numerical attributes, etc.
Learning Decision Rules
• Decision Rules
• Basic Sequential Covering Algorithm
• Learn-One-Rule Procedure
• Pruning
Definition of Decision Rules
Definition: Decision rules are rules with the following form:
if <conditions> then concept C.
Example: If you run the Prism algorithm from Weka on the weather
data you will get the following set of decision rules:
if outlook = overcast then PlayTennis = yes
if humidity = normal and windy = FALSE then PlayTennis = yes
if temperature = mild and humidity = normal then PlayTennis = yes
if outlook = rainy and windy = FALSE then PlayTennis = yes
if outlook = sunny and humidity = high then PlayTennis = no
if outlook = rainy and windy = TRUE then PlayTennis = no
Why Decision Rules?
• Decision rules are more compact.
• Decision rules are more understandable.
X
Example: Let X {0,1}, Y {0,1},
Z {0,1}, W {0,1}. The rules are:
1
0
Z
Y
if X=1 and Y=1 then 1
if Z=1 and W=1 then 1
1
0
1
0
1
Z
W
0
Otherwise 0;
1
0
1
0
W
0
1
0
1
0
1
0
Why Decision Rules?
Decision boundaries of decision trees
++
+
+
+ +
-
-
-
+
+
+
-
+
+
+
-
-
-
-
-
-
-
-
Decision boundaries of decision rules
++
+
+
+ +
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
How to Learn Decision Rules?
1. We can convert trees to rules
2. We can use specific rule-learning methods
Sequential Covering Algorithms
function LearnRuleSet(Target, Attrs, Examples, Threshold):
LearnedRules :=
Rule := LearnOneRule(Target, Attrs, Examples)
while performance(Rule,Examples) > Threshold, do
LearnedRules := LearnedRules {Rule}
Examples := Examples \ {examples covered by Rule}
Rule := LearnOneRule(Target, Attrs, Examples)
sort LearnedRules according to performance
return LearnedRules
Illustration
+
-
-
+
+
+
+
+
+
+
+
-
+
+
+
-
-
-
IF true THEN pos
-
-
-
Illustration
+
-
-
+
+
+
+
+
+
+
+
-
+
+
+
-
-
-
IF A
true
THEN
THEN
pospos
-
-
-
Illustration
+
-
-
+
+
+
+
+
+
+
-
+
+
+
+
-
-
-
-
IF A
true
THEN
& THEN
B THEN
pospospos
-
-
Illustration
+
-
-
+
+
+
+
+
+
+
-
+
+
+
+
-
-
-
-
IF A & B THEN pos
IF true THEN pos
-
-
Illustration
+
-
-
+
+
+
+
+
+
+
-
+
+
+
+
-
-
-
-
IF A & B THEN pos
IF C
true
THEN
THEN pos
pos
-
-
Illustration
+
-
-
+
+
+
+
+
+
+
-
+
+
+
+
-
-
-
-
IF A & B THEN pos
IF C
true
THEN
& THEN
D THEN
pos
pospos
-
-
Learning One Rule
To learn one rule we use one of the strategies below:
• Top-down:
– Add literals one by one
• Bottom-up:
– Remove literals one by one
• Combination of top-down and bottom-up:
– Candidate-elimination algorithm.
Bottom-up vs. Top-down
Bottom-up: typically more specific rules
+
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
-
-
-
-
-
Top-down: typically more general rules
-
Learning One Rule
Bottom-up:
• Example-driven (AQ family).
Top-down:
• Generate-then-Test (CN-2).
Example of Learning One Rule
Heuristics for Learning One Rule
– When is a rule “good”?
• High accuracy;
• Less important: high coverage.
– Possible evaluation functions:
• Relative frequency: nc/n, where nc is the number of correctly
classified instances, and n is the number of instances covered
by the rule;
• m-estimate of accuracy: (nc+ mp)/(n+m), where nc is the
number of correctly classified instances, n is the number of
instances covered by the rule, p is the prior probablity of the
class predicted by the rule, and m is the weight of p.
• Entropy.
How to Arrange the Rules
1. The rules are ordered according to the order they have been
learned. This order is used for instance classification.
2. The rules are ordered according to their accuracy. This
order is used for instance classification.
3. The rules are not ordered but there exists a strategy how to
apply the rules (e.g., an instance covered by conflicting
rules gets the classification of the rule that classifies
correctly more training instances; if an instance is not
covered by any rule, then it gets the classification of the
majority class represented in the training data).
Approaches to Avoiding Overfitting
• Pre-pruning: stop learning the decision
rules before they reach the point where they
perfectly classify the training data
• Post-pruning: allow the decision rules to
overfit the training data, and then postprune the rules.
Post-Pruning
1.
2.
3.
4.
Split instances into Growing Set and Pruning Set;
Learn set SR of rules using Growing Set;
Find the best simplification BSR of SR.
while (Accuracy(BSR, Pruning Set) >
Accuracy(SR, Pruning Set) )
do
4.1
SR = BSR;
4.2
Find the best simplification BSR of SR.
5. return BSR;
Incremental Reduced Error Pruning
Post-pruning
D1
D2
D3
D1 D21
D3
D22
Incremental Reduced Error Pruning
1.
2.
3.
4.
4.1
4.2
4.2
5.
Split Training Set into Growing Set and Validation Set;
Learn rule R using Growing Set;
Prune the rule R using Validation Set;
if performance(R, Training Set) > Threshold
Add R to Set of Learned Rules
Remove in Training Set the instances covered by R;
go to 1;
else return Set of Learned Rules
Summary Points
1. Decision rules are easier for human comprehension
than decision trees.
2. Decision rules have simpler decision boundaries than
decision trees.
3. Decision rules are learned by sequential covering of
the training instances.
Model Evaluation Techniques
• Evaluation on the training set: too optimistic
Classifier
Training set
Training set
Model Evaluation Techniques
• Hold-out Method: depends on the make-up
of the test set.
Classifier
Training set
Test set
Data
• To improve the precision of the hold-out method:
it is repeated many times.
Model Evaluation Techniques
• k-fold Cross Validation
Classifier
Data
train
train
test
train
test
train
test
train
train
Intro to Weka
@relation weather.symbolic
@attribute outlook {sunny, overcast, rainy}
@attribute temperature {hot, mild, cool}
@attribute humidity {high, normal}
@attribute windy {TRUE, FALSE}
@attribute play {TRUE, FALSE}
@data
sunny,hot,high,FALSE,FALSE
sunny,hot,high,TRUE,FALSE
overcast,hot,high,FALSE,TRUE
rainy,mild,high,FALSE,TRUE
rainy,cool,normal,FALSE,TRUE
rainy,cool,normal,TRUE,FALSE
overcast,cool,normal,TRUE,TRUE
………….
``` | 5,188 | 17,910 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.578125 | 3 | CC-MAIN-2017-17 | longest | en | 0.68255 |
https://www.quesba.com/questions/refer-to-the-previous-two-exercises-professor-lock-s-students-also-tipped-p-41789 | 1,659,889,621,000,000,000 | text/html | crawl-data/CC-MAIN-2022-33/segments/1659882570651.49/warc/CC-MAIN-20220807150925-20220807180925-00070.warc.gz | 852,447,658 | 31,120 | # Refer to the previous two exercises. Professor Lock’s students also “tipped” pennies by standing...
Refer to the previous two exercises. Professor Lock’s students also “tipped” pennies by standing them on edge and then banging the table to see which way they would fall. The students found 10,087 heads in 14,611 tips. Answer parts (a) to (g) of the previous question with regard to penny tipping rather than flipping or spinning
Mar 24 2020| 11:35 AM |
## Related Questions
### Do college professors who use a red pen to grade student essays tend to assign lower scores, on...
Do college professors who use a red pen to grade student essays tend to assign lower scores, on average, than professors who use a blue pen to grade student essays? Describe how you could design a randomized experiment to investigate this question
Mar 24 2020
### For a given data set, a test of association based on a slope is equivalent to a test of association.
For a given data set, a test of association based on a slope is equivalent to a test of association based on a correlation coefficient. Being equivalent means which of the following is true?  A. The confidence intervals for the population correlation and population slope will be the same.  B. The observed correlation will be the same as the observed slope of the regression line. C. The...
Mar 24 2020
### Suppose that you record the daily high temperature and the daily amount of ice cream sold by an ice.
Suppose that you record the daily high temperature and the daily amount of ice cream sold by an ice cream vendor at your favorite beach this summer, starting on Memorial Day weekend and ending on Labor Day weekend. Would you expect to find a positive or negative association between these variables? Explain briefly.
Mar 24 2020
### a. Why is it not possible to conclude from the data that decibel levels increase as it gets later in
a.        Why is it not possible to conclude from the data that decibel levels increase as it gets later in the day? b. How could the design of the study be improved in order to allow better conclusions about the effect of time of day on noise level?
Mar 24 2020
### For the data in the table below: i. What do the correlation coefficients of 1, shaded in yellow,...
For the data in the table below: i. What do the correlation coefficients of 1, shaded in yellow, indicate? ii. The highest correlation coefficient is 0.84, shaded in green. What can you infer from that score about the relationship between the two variables? iii.The two lowest correlation coefficients are 0.06 and -0.06. What can you infer from that score about the relationship between the two...
Mar 19 2020 | 601 | 2,723 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.796875 | 3 | CC-MAIN-2022-33 | latest | en | 0.928218 |
http://catalog.pierce.ctc.edu/preview_course_nopop.php?catoid=13&coid=24088 | 1,643,179,429,000,000,000 | text/html | crawl-data/CC-MAIN-2022-05/segments/1642320304915.53/warc/CC-MAIN-20220126041016-20220126071016-00160.warc.gz | 13,059,929 | 11,993 | 2021-2022 Pierce College Catalog
Select a Catalog 2017-2018 Pierce College Catalog [ARCHIVED CATALOG] 2018-2019 Pierce College Catalog [ARCHIVED CATALOG] 2019-2020 Pierce College Catalog [ARCHIVED CATALOG] 2020-2021 Pierce College Catalog [ARCHIVED CATALOG] 2021-2022 Pierce College Catalog
Jan 25, 2022
HELP 2021-2022 Pierce College Catalog Print-Friendly Page (opens a new window)
# ABE 042 ABE High Intermediate Basic Education - Math 4 (1 to 6 credits
Course Description
Designed for students to learn and/or review fractions, decimals, percents, beginning algebra, measurement, and basic geometry math skills in preparation for passing of the GED exam or college entry exam.
Student Outcomes
1. Mathematics
M4.1 Read, write, and interpret a variety of common mathematical information such as
Numbers and number sense: monetary values, extensions of benchmark fractions (1/8, 1/3, 1/5, etc), decimals, and percents (15%, 30%, etc.).
Patterns/Functions/Relationships: patterns and simple formulas (such as d=rt, a=lw); Space/Shape/Measurement: standard units of measurement including fractional units and benchmark angle measurements (90 degrees, 360 degrees, etc), geometric shapes including shapes containing a combination of common shapes, concept of pi, and concept of converting between units of measurement.
Data/Statistics: ways to interpret and represent data (tables and graphs with scaling, basic statistical concepts such as range, mode, mean, and median).
M4.2 Recall and use a good store of mathematical procedures such as estimation, rounding, multiplication and division (with and without use of a calculator), adding and subtracting, multiplying and dividing common fractional amounts and decimals, measure length, weight, area and circumference using tools calibrated to varying degrees of precision and converting units of measurement as appropriate.
M4.3 Evaluate the degree of precision needed for the solution.
M4.4 Define, select and organize a variety of common mathematical data and measure with appropriate tools, describe patterns, and/or use appropriate procedures effectively to solve a problem and verify that the solution is reasonable.
M4.5 Communicate the solution to the problem orally, with visual representations, in writing, by entries in a table or appropriate graph, or with basic statistics (range, mode, mean, median).
4. Goal Setting
G4.1 Monitor progress on educational goals as they relate to their roles as students, workers, citizens, and family members. | 547 | 2,507 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.609375 | 4 | CC-MAIN-2022-05 | latest | en | 0.85285 |
https://movies.stackexchange.com/questions/71499/how-much-money-was-the-last-bet/103082 | 1,719,239,260,000,000,000 | text/html | crawl-data/CC-MAIN-2024-26/segments/1718198865383.8/warc/CC-MAIN-20240624115542-20240624145542-00286.warc.gz | 352,933,702 | 34,459 | # How much money was the last bet?
In The Gambler Jim Bennett places a huge amount on black:
The amount seems to be more money than he owed if he won, but he leaves declaring he is not a gambler and leaves the money to be split between Frank and Lee.
So how much money did he bet?
### His final bet was 400 000\$ and there are two ways to look into it.
First it is not said in the movie or written in script how much he bet at the final scene on Roulette. But we can see from the picture the amount of money, bills and currency straps placed on Roulette table.
These are common movie prop-money. Yellow currency straps represents stacks of 10 000\$ of 100\$ bills. The other currency straps seems to be more brownish (50% bill) than red (5\$ bill) strap. Also the back of brownish strap bill seems to be more of 50\$ than 5\$ bill, so the stack represents 5000\$. We can see that there are 38 yellow currency straps and 4 brown straps - that totals to 400 000\$.
From movie perspective we can calculate his final bet by working his debt and bets backwards. His full debt before the final bet was 636 000\$. He owed to Frank 286 000\$ (260 000 + 10% per week)₁ and to Mister Lee 350 000\$. Now the problem is, that we do not know what was the exact bet at Roulette wheel, because we do not know how much he won from betting at Lamar´s game₂. But we learn at the end of movie that Frank offered Jim 100 000\$ that was "little extra on the top for him", that Jim declined₃.
We know that Roulette (red or black) bet ratio is 2:1 and all Jim´s loans were paid off with at least 100 000\$ on top (736 000\$), the initial bet must have been at least 368 000\$ to achieve it. It is never said in the movie if Mister Lee also took interest on money, but it would be wrong to assume that he would loan it for free. So from calculations I would assume either the remaining 64 000\$ (800 000\$ - 736 000\$) was interest or "little extra" for Mister Lee.
₁ When he first approached Frank it was stated that rate is 10% per week.
₂ He paid lamar 150 000\$ (second loan from Mister Lee) for throwing a game by not winning more than 8 points. 260 000\$ (loan from Frank) was betted at Lamars game by Jim, but we did not learn how much he actually won.
₃ The 100 000\$ extra money, that Jim leaves for Mister Lee and Frank on Roulette table may not be intentional, because previous to final bet he offered 50 000\$ to Dexter for making a trip to Vegas and placing a bet on Lamar's game, but Dexter declined it. | 631 | 2,504 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.34375 | 4 | CC-MAIN-2024-26 | latest | en | 0.973743 |
http://mathhelpforum.com/number-theory/12909-chinese-rem-thm-print.html | 1,527,240,821,000,000,000 | text/html | crawl-data/CC-MAIN-2018-22/segments/1526794867055.20/warc/CC-MAIN-20180525082822-20180525102822-00250.warc.gz | 189,011,842 | 3,840 | # Chinese Rem. Thm.
• Mar 24th 2007, 01:51 PM
Ideasman
Chinese Rem. Thm.
1.) Utilizing the Chin. Rem. Thm., find 5 consec. pos. integers such that the following conditions hold: the first is div. by 2, the 2nd is div by 3, the 3rd is div by 5, the 4th is div. by 7 and the final (the 5th) is div. by 11.
2.) Now, prove for any pos. integer n, there will exist n consecutive pos. integers a_1, a_2, ..., a_n, such that p_i | a_i for each i, where the p_i illustrates the i-th prime.
• Mar 24th 2007, 07:24 PM
ThePerfectHacker
Quote:
Originally Posted by Ideasman
1.) Utilizing the Chin. Rem. Thm., find 5 consec. pos. integers such that the following conditions hold: the first is div. by 2, the 2nd is div by 3, the 3rd is div by 5, the 4th is div. by 7 and the final (the 5th) is div. by 11.
Let x be the first positive integer.
Then,
x = 0 (mod 2)
x+1 = 0 (mod 3)
x+2 = 0 (mod 5)
x+3 = 0 (mod 7)
x+4 = 0 (mod 11)
Hence,
x = 0 (mod 2)
x = -1 (mod 3)
x = -2 (mod 5)
x = -3 (mod 7)
x = -4 (mod 11)
Write in normal form,
x = 0 (mod 2)
x = 2 (mod 3)
x = 3 (mod 5)
x = 4 (mod 7)
x = 7 (mod 11)
And the moduli are relatively prime to each other, that is exactly the form we need.
• Mar 24th 2007, 07:26 PM
ThePerfectHacker
Quote:
Originally Posted by Ideasman
2.) Now, prove for any pos. integer n, there will exist n consecutive pos. integers a_1, a_2, ..., a_n, such that p_i | a_i for each i, where the p_i illustrates the i-th prime.
Just generalize what I did.
And we end up with the following congruences,
x = 0 (mod p_1)
x = -1 (mod p_2)
....
x = -(n-1) (mod p_n)
Because these are prime numbers we have that,
gcd(p_i,p_j)=1
For 1<= i,j<=n
And hence by the Chinese Remainder Theorem there exists such an integer.
Q.E.D.
• Mar 24th 2007, 08:31 PM
Ideasman
Quote:
Originally Posted by ThePerfectHacker
Just generalize what I did.
And we end up with the following congruences,
x = 0 (mod p_1)
x = -1 (mod p_2)
....
x = -(n-1) (mod p_n)
Because these are prime numbers we have that,
gcd(p_i,p_j)=1
For 1<= i,j<=n
And hence by the Chinese Remainder Theorem there exists such an integer.
Q.E.D.
Why are you so smart? You're simply amazing
Thanks
• Mar 24th 2007, 08:32 PM
Jhevon
Quote:
Originally Posted by Ideasman
Why are you so smart? You're simply amazing
Thanks
i think it's these weird drugs he's taking
• Mar 25th 2007, 05:11 AM
ThePerfectHacker
Quote:
Why are you so smart? You're simply amazing
Because I came from Union of Soviet Socialist Republic.
Quote:
i think it's these weird drugs he's taking
What did Erdos use again?
• Mar 27th 2007, 12:22 AM
Ideasman
Quote:
Originally Posted by ThePerfectHacker
Let x be the first positive integer.
Then,
x = 0 (mod 2)
x+1 = 0 (mod 3)
x+2 = 0 (mod 5)
x+3 = 0 (mod 7)
x+4 = 0 (mod 11)
Hence,
x = 0 (mod 2)
x = -1 (mod 3)
x = -2 (mod 5)
x = -3 (mod 7)
x = -4 (mod 11)
Write in normal form,
x = 0 (mod 2)
x = 2 (mod 3)
x = 3 (mod 5)
x = 4 (mod 7)
x = 7 (mod 11)
And the moduli are relatively prime to each other, that is exactly the form we need.
Hi TPH,
I was following your work. Once you get to the "normal form" it is now that I have to use the Chinese Remainder Theorem right? This will give me the 5 consecutive pos integers?
• Mar 27th 2007, 09:43 AM
ThePerfectHacker
Quote:
Originally Posted by Ideasman
Hi TPH,
I was following your work. Once you get to the "normal form" it is now that I have to use the Chinese Remainder Theorem right? This will give me the 5 consecutive pos integers?
Yes, but be careful, x is the first among these integers.
• Mar 27th 2007, 06:48 PM
Ideasman
Quote:
Originally Posted by ThePerfectHacker
Yes, but be careful, x is the first among these integers.
Alright, I attempted doing the chinese rem. theorem but ran into difficulty. In my notes, I have:
x = a_1*M_1*y_1 + a_2*M_2*y_2 + ... a_k*M_k*y_k ; m_i = M/m_i and y_i satisfies M_i*y_i = 1 (mod m_i)
Ah this formula looks confusing and I think it's simpler than I am making it out to be. It would have been nice if my prof. at least gave us an example.
• Aug 2nd 2012, 10:45 AM
davidsmith
Re: Chinese Rem. Thm.
• Aug 3rd 2012, 01:37 AM
kraj8995
Re: Chinese Rem. Thm.
I like this concept.I have read something like it very long ago. | 1,451 | 4,207 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.9375 | 4 | CC-MAIN-2018-22 | latest | en | 0.898174 |
https://mathoverflow.net/questions/87916/simple-proofs-for-the-existence-of-elliptic-curves-having-a-given-number-of-poin?noredirect=1 | 1,723,481,958,000,000,000 | text/html | crawl-data/CC-MAIN-2024-33/segments/1722641045630.75/warc/CC-MAIN-20240812155418-20240812185418-00268.warc.gz | 294,103,547 | 27,441 | # Simple proofs for the existence of elliptic curves having a given number of points
Yesterday, after he gave a nice talk, Dick Gross and I were chatting and he brought up the following annoying problem: suppose that for $p$ a prime that $H_p$ is the "Hasse interval" $[p+1- 2 \sqrt{p},p+1+2\sqrt{p}]$. Then, for every point $r \in H_p$ there is an elliptic curve $E_{a,b}: y^2 = x^3 + a x + b$ over $\mathbb{F}_p$ such that $N_p(E_{a,b}) = r$, where $N_p(C)$ denotes the number of projective points of the curve $C$. But the only proof that we knew of this fact involved the whole theory of complex multiplication and Deuring's theorems about reduction. So the question arose if there is a simpler proof of this fact, say by using $p$-adic methods. I even asked for the weaker case: let $H_p' = [p+\sqrt{p},p+2\sqrt{p}]$. Can you prove the existence of an $E_{a,b}$ with $N_p(E_{a,b}) \in H_p'$ with a fairly simple proof?
On the converse side, there's Hasse's proof of the Riemann Hypothesis for elliptic curves over finite fields, that $N_p(E_{a,b}) \in H_p$, which does involve a fair amount of machinery (even though it's been simplified). Suppose that we're after the weaker statement:
There are absolute constants $0 < c_1 < c_2$ such that if $y^2 = x^3 + a x + b$ is an elliptic curve over $\mathbb{Q}$ then, for sufficiently large primes $p$
$c_1 p \le N_p(E_{a,b}) \le c_2 p$.
More generally, if $f(x,y) \in \mathbb{Q}[x,y]$ is an absolutely irreducible polynomial of total degree $d$ that there are $0 < c_1 < c_2$ only depending on $d$ such that
$c_1 p \le N_p(f) \le c_2 p$ for all sufficiently large primes $p$.
Again, how simple a proof is there for this statement?
When $f(x,y) = a x^2 + b y^2 + c$ which is genus 0, the simplest proof I know of consists in showing
1) If there is a point $P$ in $\mathbb{F}_p^2$ on $f$, then one can explicitly construct a one-to-one correspondence between the projective points on $f$ and the projective line, by using the pencil of lines through $P$.
2) Use the pigeon hole principle to show the existence of a point on $f$:
If $a \ne 0$ there are exactly $(p+1)/2$ values of $a x^2$, so we can see that the intersection $\{ax^2\} \cap \{-(c + by^2)\}$ has at least one point (we just barely made it).
I know of no such simple proof for an elliptic curve $E$.
• Re your sentence starting "more generally": The upper bound is easy. There is a $d \to 1$ map to $\mathbb{P}^1$, so there can't be more than $d (p+1)$ points. But I think the lower bound will already be nontrivial, since it is not true for $f$ reducible. Commented Feb 8, 2012 at 18:30
• For an elliptic curve in Weierstrass form $c_2=2$ is obvious and $c_2=d$ is equally obvious by letting $x$ vary and solving for $y$. Note also that, in the elliptic curve case $c_1=2-c_2$ because of twisting. These are just obvious remarks. Commented Feb 8, 2012 at 18:31
• @Felipe and @David, thanks. So for elliptic curves, all one needs to do is to show that $c_2 < 2$. Commented Feb 8, 2012 at 18:33
• Is Stepanov's method elementary enough? ("An elementary proof of the Hasse-Weil theorem for hyperelliptic curves", J. Number Theory 4 (1972), 118–143.) Commented Feb 8, 2012 at 18:44
• @Noam, I had remembered Stepanov's proof (though had forgotten the reference). It is fairly elementary, but does involve a bit of machinery. See Felipe's answer below for something which is pretty concise. Commented Feb 8, 2012 at 19:01
If you write your cubic as $y^2=f(x)$, let $M$ be the cardinality of of $S =\lbrace x \in \mathbb{F}_p, f(x)^{(p-1)/2} = 1 \rbrace$, so $M$ is related to the number of points on the cubic in an obvious way.
Define $G(x) = f(x)(f(x)^{(p-1)/2}-1) - f'(x)(x^p-x)/2$. Exercise, check that $G$ has double zeros on the elements of $S$. As $G$ has degree $3(p+1)/2$ we get $M \le 3(p+1)/4$ and $c_2=3/2, c_1=1/2$.
Edit: In the case of a general plane curve $f=0$ of degree $d$, you can use $G= (x^p-x)\partial f/\partial x + (y^p-y)\partial f/\partial y$. Again $G$ has double zeros on the $\mathbb{F}_p$-rational points of curve and meets the curve in finitely many points if $d$ is less than $p$ and $f=0$ has no linear component. So, in this case, the number of points is at most $d(d+p-1)/2$ by Bezout, i.e. $c_2= d/2$. Details are slightly harder to fill than the elliptic curve case. Also, there is no twisting so no corresponding lower bound.
• This reminds me of an old paper of Bryan Birch "How the number of points on an elliptic curve over a fixed prime field varies": jlms.oxfordjournals.org/content/s1-43/1/57.full.pdf In it he calculates exact values for the moments of the distribution: $C_k(p) := (1/p^2) \sum_{a,b} N_p(E_{a,b})^k$ in terms of coefficients of modular forms. Commented Feb 9, 2012 at 1:11 | 1,504 | 4,757 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.078125 | 3 | CC-MAIN-2024-33 | latest | en | 0.912383 |
https://www.unbounded.org/math/grade-4/module-3/topic-h/lesson-34 | 1,576,427,803,000,000,000 | text/html | crawl-data/CC-MAIN-2019-51/segments/1575541308604.91/warc/CC-MAIN-20191215145836-20191215173836-00336.warc.gz | 900,366,704 | 115,512 | lesson 34
1 hour
# Multiply Two-Digit Multiples Of 10: Place Value Chart
### Description
Objective: Multiply two-digit multiples of 10 by two-digit numbers using a place value chart.
Lesson 34 begins this topic by having students use the area model to represent and solve the multiplication of two-digit multiples of 10 by two-digit numbers using a place value chart. Practice with this model helps to prepare students for two-digit by two-digit multiplication and builds the understanding of multiplying units of 10. | 108 | 522 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.78125 | 3 | CC-MAIN-2019-51 | latest | en | 0.826581 |
https://www.studypool.com/discuss/498214/i-need-help-with-two-questions-for-my-calculus-2?free | 1,480,913,229,000,000,000 | text/html | crawl-data/CC-MAIN-2016-50/segments/1480698541525.50/warc/CC-MAIN-20161202170901-00270-ip-10-31-129-80.ec2.internal.warc.gz | 1,019,907,322 | 14,407 | ##### i need help with two questions for my calculus..
Calculus Tutor: None Selected Time limit: 1 Day
Apr 27th, 2015
first problem
This is relatively easy to do by the method of disks, where a typical disk has radius x(k-x) and width dx. Thus the volume of the solid of revolution is given by
V = pi int_{x=0}^{x=k} x^2(k-x)^2 dx
= pi int_{x=0}^{x=k} x^2(k^2 - 2kx + x^2) dx
= pi [k^2(x^3/3) - 2k(x^4/4) + x^5/5]_{x=0}^{x=k}
= pi [k^5/3 - k^5/2 + k^5/5]
= pi(k^5/30)[10 - 15 + 6]
= pi(k^5/30).
second problem
you could probably do this by the method of disks, but the radii of the outer and inner disks in this case are rather awkward functions involving the (two) solutions of x(k-x) = y (in terms of x). So let's use the method of shells instead, where the typical shell has radius x and height x(k-x). Then the volume of the solid of revolution is given by
V = 2pi int_{x=0}^{x=k} x^2(k-x) dx
= 2pi [kx^3/3 - x^4/4]_{x=0}^{x=k}
= 2pi [k^4/3 - k^4/4]
= pi(k^4)/6.
Apr 27th, 2015
Apr 28th, 2015
can you write it by hand and upload as pdf
Apr 28th, 2015
...
Apr 27th, 2015
...
Apr 27th, 2015
Dec 5th, 2016
check_circle | 439 | 1,132 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.15625 | 4 | CC-MAIN-2016-50 | longest | en | 0.883707 |
https://iitutor.com/multiplication-using-exponents-indices/ | 1,716,749,117,000,000,000 | text/html | crawl-data/CC-MAIN-2024-22/segments/1715971058972.57/warc/CC-MAIN-20240526170211-20240526200211-00135.warc.gz | 262,502,899 | 27,256 | Multiplication using Exponents (Indices)
If we wish to calculate $5^4 \times 5^3$, we could write in factor form to get:
\begin{align} \displaystyle 5^4 \times 5^3 &= (5 \times 5 \times 5 \times 5) \times (5 \times 5 \times 5) \\ &= 5^7 \end{align}
Example 1
Simplify $7^2 \times 7^3$ after first writing in factor form.
\begin{align} \displaystyle 7^2 \times 7^3 &= (7 \times 7) \times (7 \times 7 \times 7) \\ &= 7^5 \end{align}
However, if we look closely, a much simpler method would be to add the exponents since the bases are the same. Therefore this calculation can also be done this way:
\begin{align} \displaystyle 5^4 \times 5^3 &= 5^{4+3} \\ &= 5^7 \end{align}
, which is the same answer.
We can add the exponents when multiplying only if the bases are the same. Thus to $\textit{multiply}$ numbers with the $\textit{same base}$, keep the base and $\textit{add}$ the exponents.
$$\large a^x \times a^y = a^{x+y}$$
Example 2
Simplify $9^3 \times 9^5$.
\begin{align} \displaystyle 9^3 \times 9^5 &= 9^{3+5} \\ &= 9^8 \end{align}
Example 3
Simplify $4^3 \times 4 \times 4^5$.
\begin{align} \displaystyle 4^3 \times 4 \times 4^5 &= 4^3 \times 4^1 \times 4^5 \\ &= 4^{3+1+5} \\ &= 4^9 \end{align}
Many questions will be algebraic, meaning that a pronumeral is used. In such questions, we multiply the coefficients and apply the multiplication rule to the pronumeral separately.
Example 4
Simplify $3x^5 \times 5x^4$.
\begin{align} \displaystyle 3x^5 \times 5x^4 &= (3 \times 5) \times (x^5 \times x^4) \\ &= 15 \times x^{5+4} \\ &= 15x^9 \end{align}
When more than one pronumeral is involved in the question, we apply this rule to each pronumeral separately.
Example 5
Simplify $3x^2 \times 2x^5 \times x \times x^3$.
\begin{align} \displaystyle 3x^2 \times 2x^5 \times x \times x^3 &= (3 \times 2) \times (x^2 \times x^5 \times x^1 \times x^3) \\ &= 6 \times x^{2 + 5 + 1 +3} \\ &= 6x^{11} \end{align}
Example 6
Expand $x^2(x^3 + 4x^5)$.
\begin{align} \displaystyle x^2(x^3 + 4x^5) &= x^2 \times x^3 + x^2 \times 4x^5 \\ &= x^{2+3} + 4x^{2+5} \\ &= x^5 + 4x^7 \end{align}
✓ Discover more enlightening videos by visiting our YouTube channel!
High School Math for Life: Making Sense of Earnings
Salary Salary refers to the fixed amount of money that an employer pays an employee at regular intervals, typically on a monthly or biweekly basis,…
Mastering Integration by Parts: The Ultimate Guide
Welcome to the ultimate guide on mastering integration by parts. If you’re a student of calculus, you’ve likely encountered integration problems that seem insurmountable. That’s…
Induction Made Simple: The Ultimate Guide
“Induction Made Simple: The Ultimate Guide” is your gateway to mastering the art of mathematical induction, demystifying a powerful tool in mathematics. This ultimate guide…
The Best Practices for Using Two-Way Tables in Probability
Welcome to a comprehensive guide on mastering probability through the lens of two-way tables. If you’ve ever found probability challenging, fear not. We’ll break it…
Binomial Expansions
The sum $a+b$ is called a binomial as it contains two terms.Any expression of the form $(a+b)^n$ is called a power of a binomial. All… | 1,036 | 3,210 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.75 | 5 | CC-MAIN-2024-22 | latest | en | 0.600817 |
http://new.pmean.com/summing-ordinal-data/ | 1,713,091,866,000,000,000 | text/html | crawl-data/CC-MAIN-2024-18/segments/1712296816879.25/warc/CC-MAIN-20240414095752-20240414125752-00594.warc.gz | 21,975,754 | 4,303 | # Summing ordinal data
## 2005-04-05
[StATS]: Summing ordinal data (April 5, 2005)
You have a questionnaire which asks several related questions on a Likert scale (1=Strongly Disagree, 2=Disagree, etc.). You want to add these items together and then report an average. Is this a legitimate thing to do?
It depends on who you talk to. There is no real consensus in the research community. That means that you are free to use whatever approach you want, but prepare yourself for the possibility that your supervisor/your dissertation committee/the journal peer reviewer will force you to switch to the “other” way.
Basically, when you assign numbers like 1, 2, 3, 4, and 5 to the categories strongly disagree, disagree, neutral, agree, strongly agree, you are making an assumption that the difference between any two successive values is comparable. So a shift from disagree to neutral is comparable to a shift from neutral to agree. Equivalently, you are assuming that a patient who strongly disagrees with half of the statements and is neutral on the remaining half is comparable to a patient who simply disagrees with all items on the scale.
A perfectly reasonable alternative is to assign the values -3, -1, 0, 1, 3 to the five categories. This assignment makes the assumption that a strong disagreement is three times as serious as a simple disagreement.
Since there is more than one reasonable way to assign numbers to the categories, you might wish to use an ordinal model that provides the same answer no matter what values you decide to assign.
This is not unlike the process of assigning grades. When you calculate a grade point average, you assign the numbers 0, 1, 2, 3, and 4 to the grades F, D, C, B, and A. Is this a reasonable thing to do? It is if you believe that a student with two B’s is comparable to a student with an A and a C. Or more extremely, you would believe that a student with two C’s is comparable to a student with an A and an F.
Perhaps you could assign alternate numbers: A=100, B=90, C=80, D=70, F=0. That would penalize someone quite strongly for a single F, much more so than the scoring system that everyone uses.
One alternative to averaging is to rank the data. With a small number of ordinal categories, the ranks would have a lot of ties. It seems like a reasonable approach, but it can sometimes give nonsensical results. Consider a salary survey that asks for your yearly salary using the following categories:
• 0 to 10 thousand dollars
• 10 to 20 thousand dollars
• 20 to 50 thousand dollars
• 50 to 100 thousand dollars
• more than 100 thousand dollars
Suppose that the number of people responding in each category is
• 49 people select 0 to 10 thousand dollars
• 21 people select 10 to 20 thousand dollars
• 9 people select 20 to 50 thousand dollars
• 3 people select 50 to 100 thousand dollars
• 3 people select more than 100 thousand dollars
Then the average ranks are 25, 60, 75, 81, and 84. This says that the difference between 0 to 10<U+FFFD> and 10 to 20 (45 units) is three times more severe than the difference between 10 to 20<U+FFFD> and 20 to 50 (15 units). Even worse, the difference between 0 to 10 and 10 to 20 is fifteen times more severe than the difference between 50 to 100 and more than 100.
A much better approach for this type of data is to assign the midpoint to each interval and assign a reasonably large value (say 150 thousand or 200 thousand) to the last interval.
There isn’t any real consensus, so you can probably find a justification for just about any type of approach in the list of readings offered below. I have no problem with averaging ordinal data, because I haven’t seen that many situations where using something more complex has resulted in a substantively different conclusion.
Further reading
• Regression models for ordinal responses: a review of methods and applications. Ananth CV, Kleinbaum DG. International Journal of Epidemiology 1997: 26(6); 1323-33.
• Pearson’s R and Coarsely Categorized Measures. Bollen KA, Barb K. American Sociological Review 1981: 46; 232-39.
• Tutorial in Biostatistics: A review of tests for detecting a monotone dose-response relationship with ordinal response data. Chuang-Stein C, Agresti A. Statistics in Medicine 1997: 16(22); 2599-618.
• Logistic Regression. Garson GD, College of Humanities and Social Sciences, North Carolina State University. Accessed on 2003-08-28. www2.chass.ncsu.edu/garson/pa765/logistic.htm
• Alternative models for ordinal logistic regression. Greenland S. Stat Med 1994: 13(16); 1665-77.
• Multivariable prognostic models: issues in developing models, evaluating assumptions and adequacy, and measuring and reducing errors. Harrell FE, Jr., Lee KL, Mark DB. Stat Med 1996: 15(4); 361-87.
• Development of a clinical prediction model for an ordinal outcome: the World Health Organization Multicentre Study of Clinical Signs and Etiological agents of Pneumonia, Sepsis and Meningitis in Young Infants. WHO/ARI Young Infant Multicentre Study Group. Harrell FE, Jr., Margolis PA, Gove S, Mason KE, Mulholland EK, Lehmann D, Muhe L, Gatchalian S, Eichenwald HF. Statistical Medicine 1998: 17(8); 909-44. [Medline]
• Multivariate Analysis and Ordinal Data. Henry F. American Sociological Review 1982: 47; 299-307.
• Ordinal Measures in Multiple Indicator Models: A Simulation of Categorization Error. Johnson D, Creech J. American Sociological Review 1983: 48; 398-407.
• Multivariate Analysis of Ordinal Variables. Kim J. American Journal of Sociology 1975: 81; 261-98.
• Multivariate Analysis of Ordinal Variables Revisited. Kim J. American Journal of Sociology 1978: 84; 448-56.
• The Assignment of Numbers to Rank Order Categories. Labovitz S. American Sociological Review 1970: 35; 515-24.
• The Use of Pearson’s R with Ordinal Data. O’Brien R. American Sociological Review 1979: 44; 851-57.
• Likelihood ratios with confidence: sample size estimation for diagnostic test studies. Simel DL, Samsa GP, Matchar DB. J Clin Epidemiol 1991: 44(8); 763-70. [Medline]
• Sample size and power estimation for studies with health related quality of life outcomes: a comparison of four methods using the SF-36. Walters SJ. Health Qual Life Outcomes 2004: 2(1); 26. [Medline] [Abstract] [Full text] [PDF]
• Data Levels and Measurement. Garson GD, North Carolina State University. Accessed on 2003-11-19. www2.chass.ncsu.edu/garson/pa765/datalevl.htm
You can find an earlier version of this page on my website. | 1,623 | 6,472 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.4375 | 3 | CC-MAIN-2024-18 | latest | en | 0.939366 |
https://magoosh.com/gmat/gmat-og-verbal-and-quantitative-review-books/ | 1,713,711,180,000,000,000 | text/html | crawl-data/CC-MAIN-2024-18/segments/1712296817780.88/warc/CC-MAIN-20240421132819-20240421162819-00102.warc.gz | 342,103,211 | 46,858 | # The GMAT OG Verbal and Quantitative Review Books
This blog concerns not the GMAT Official Guide itself, but two supplementary volumes. The recent second edition GMAT books were:
This year, with the publication of the OG2015, GMAC released even newer editions:
This blog will discuss what these books are and what the difference is between the two editions.
## The Review Books
Fundamentally, these are practice books with more official practice problems, problems that do not appear in the GMAT Official Guide. Think about that: more official GMAT practice problems, from the very people who write the test. Is this a recommended study resource? Of course, of course, of course. There is absolutely nothing better with which to practice than the official GMAT practice questions, and especially if you have already exhausted the questions in the Official Guide, this would be a new batch of questions you could try.
Both review books have the introductory sections for the questions, explaining the question type: these sections are identical to those in the OG. Also, the Quantitative book has the “Math Review” section, identical to that in the OG. The Quantitative volume contains 176 Problem Solving questions and 124 Data Sufficiency questions. That’s 300 practice math questions, above and beyond what’s in the OG. The Verbal volume contains 18 RC passages & 104 Reading Comprehension questions, 83 Critical Reasoning questions, and 113 Sentence Correction questions. That’s 300 practice verbal questions, above and beyond what’s in the OG. Again, these are highly recommended study tools.
I will just issue a caution here. Generally, students need a lot of practice to prepare adequately for the GMAT. Some students begin with the noble intention: I will only use official material. Well, that’s great in theory, but in practice, many times these students work through the entire OG, then need to study more and have already used the best resources — not an optimal situation! In the Magoosh study plans, we recommend starting with other questions, Magoosh questions and MGMAT questions, and as you build skills, working up to the OG questions, so that you get the most from those high quality questions.
## Second edition vs. 2015 edition
Now, what is the difference between #1 & #3? between #2 & #4? Well, very much like the OG2015, these new books, #3 & #4, are absolutely identical to the earlier editions, #1 & #2, in terms of the printed copy. Same 300 Verbal questions, same 300 math questions. Same introductions, same explanations. The books are identical except for different colors in the designs.
BUT, as with the OG2015, what you get with #3 & #4 that you don’t get with #1 & #2 are the same questions presented in an online form. With each new book, you get the exact same 300 questions in a online format, which, theoretically, is slightly more GMAT-like.
If you own #1 and/or #2, should you invest in the new books? Well, only if you want to practice the same questions in an online format. This seems a small gain for the price of new books.
If you own #3 and/or #4, would it make sense to buy #1 or #2? No, there would be absolutely no reason to do so.
If you are starting now, which ones should you buy? Well, if the prices are comparable, definitely get #3 and #4, which have all the questions in #1 & #2 as well as the same question presented in an online question banks. If you can find #1 & #2 for considerably cheaper, and you don’t feel the need to practice the same questions online, then it might make sense simply to get #1 & #2.
## Summary
If you have run out of questions in the OG, or anticipate doing so, and want more questions, these books are the very best places to go next. Each hard copy volume gives you 300 practice questions, and each of the 2015 editions comes with the same 300 practice questions also presented in an online form. Together, these books present 600 new questions not found in the OG.
If you have any experiences with these books that you would like to share, please let us know.
## Author
• Mike served as a GMAT Expert at Magoosh, helping create hundreds of lesson videos and practice questions to help guide GMAT students to success. He was also featured as “member of the month” for over two years at GMAT Club. Mike holds an A.B. in Physics (graduating magna cum laude) and an M.T.S. in Religions of the World, both from Harvard. Beyond standardized testing, Mike has over 20 years of both private and public high school teaching experience specializing in math and physics. In his free time, Mike likes smashing foosballs into orbit, and despite having no obvious cranial deficiency, he insists on rooting for the NY Mets. Learn more about the GMAT through Mike’s Youtube video explanations and resources like What is a Good GMAT Score? and the GMAT Diagnostic Test. | 1,108 | 4,882 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.203125 | 3 | CC-MAIN-2024-18 | latest | en | 0.901185 |
http://hrwiki.org/w/index.php?title=Talk:The_House_That_Gave_Sucky_Tricks&diff=785550&oldid=753572&printable=yes | 1,601,043,545,000,000,000 | text/html | crawl-data/CC-MAIN-2020-40/segments/1600400226381.66/warc/CC-MAIN-20200925115553-20200925145553-00318.warc.gz | 65,857,288 | 11,783 | # Talk:The House That Gave Sucky Tricks
(Difference between revisions)
Jump to: navigation, search
Revision as of 16:01, 21 November 2015 (edit) (→I Wanna Speak To Cookie Puss, Man!: reply)← Older edit Current revision as of 23:57, 4 August 2019 (edit) (undo) (includes 16 intermediate revisions) Line 29: Line 29: == "A 220 in four-fourty-five" == == "A 220 in four-fourty-five" == - Could we get an Explanation on this? Is "220 in 4:45" even remotely impressive? + Could we get an Explanation on this? Is "220 in 4:45" even remotely impressive? {{unsigned|24.6.5.112|20:40, 4 November 2015}} ==Horror Experience Room == ==Horror Experience Room == - The whole "immersive horror experience room" is at least a reference to [https://en.wikipedia.org/wiki/Race_to_Escape Race to Escape] (complete with ridiculous leaps in logic). + The whole "immersive horror experience room" is at least a reference to [https://en.wikipedia.org/wiki/Race_to_Escape Race to Escape] (complete with ridiculous leaps in logic). {{unsigned|74.212.42.241|20:31, 5 November 2015}} :And other things of that nature. There are many such things in existence. {{User:DeFender1031/sig}} 20:52, 5 November 2015 (UTC) :And other things of that nature. There are many such things in existence. {{User:DeFender1031/sig}} 20:52, 5 November 2015 (UTC) Line 49: Line 49: == I Wanna Speak To Cookie Puss, Man! == == I Wanna Speak To Cookie Puss, Man! == - Could the KoT's Cookie Puss line be a reference to an early Beastie Boys number by the same name? I only ask because the Beasties are referenced multiple times throughout the site. + Could the KoT's Cookie Puss line be a reference to an early Beastie Boys number by the same name? I only ask because the Beasties are referenced multiple times throughout the site. {{unsigned|YoghNess|19:42, 17 November 2015}} :[[Wikipedia:Cookie Puss|nope]]. {{User:DeFender1031/sig}} 20:18, 17 November 2015 (UTC) :[[Wikipedia:Cookie Puss|nope]]. {{User:DeFender1031/sig}} 20:18, 17 November 2015 (UTC) ::I know Cookie Puss is a real mascot, but this wouldn't be the first sneaky reference. [http://www.hrwiki.org/wiki/Popular_Music_References#Beastie_Boys] [http://www.hrwiki.org/wiki/File:BubsMCA.png] [http://i.imgur.com/qoHbraU.png] {{User:YoghNess/sig}} ::I know Cookie Puss is a real mascot, but this wouldn't be the first sneaky reference. [http://www.hrwiki.org/wiki/Popular_Music_References#Beastie_Boys] [http://www.hrwiki.org/wiki/File:BubsMCA.png] [http://i.imgur.com/qoHbraU.png] {{User:YoghNess/sig}} :::I don't know why you call those references "sneaky", but there's absolutely NOTHING here to suggest KoT is referring to anything other than the mascot. {{User:DeFender1031/sig}} 16:01, 21 November 2015 (UTC) :::I don't know why you call those references "sneaky", but there's absolutely NOTHING here to suggest KoT is referring to anything other than the mascot. {{User:DeFender1031/sig}} 16:01, 21 November 2015 (UTC) + + == Beetlejuice Cartoon, maybe? == + + I'm curious if Homestar's song might be a reference to an old episode of the Beetlejuice animated series which took place on a tropical island and ended with the same "Da-bo-dee-bo-da!" scat song. {{unsigned|184.59.149.197|19:08, 25 November 2015}} + :Given that he's already mentioned Beetlejuice, it's likely, but we'll need a direct reference to a specific episode rather than a vague description of one. {{User:DeFender1031/sig}} 12:29, 26 November 2015 (UTC) + ::Season 1 Episode 18, Quit while you're a head. I just looked up the episode on dailymotion. Skip to about the 22:00 mark. {{unsigned|184.59.149.197|21:17, 6 December 2015}} + :::That certainly seems like a direct reference. {{User:Mee/sig}} 12:44, 7 December 2015 (UTC) + + == Strong Sad's nitpicking? == + I've noticed a trend of Strong Sad correcting people (Pseudonym, anyone?) - should this be noted as a running gag or just a facet of his personality on his own article? Perhaps it could be paired with those times he's grammatically wrong, as that seems to be part of the joke- a pretentious know-it-all who frequently makes his own mistakes. [[Special:Contributions/50.206.151.149|50.206.151.149]] 16:50, 2 December 2016 (UTC) + :Interesting idea. Can you give other examples besides this toon and [[secret identity]]? Or examples of when he's grammatically wrong? (I can't think of many of those.) I'm not sure if it would qualify as a page-able running gag, but maybe we ''should'' note it on [[Strong Sad|his page]]. {{User:SRMX12/sig}} 18:25, 2 December 2016 (UTC) + ::Strong Sad is the Strong Bad Email police. Strong Sad [[technology|complained that both 5" and 3 1/2" disks are both floppies]] and [[narrator|that Strong Bad's octopus-toss was a change-up, not a curveball]]. That's three Strong Bad Emails in a row. Not to mention that you get an achievement in [[Homestar Ruiner]] for getting Strong Sad to show up an nitpick about lemmings and such. [[Special:Contributions/99.48.86.26|99.48.86.26]] 00:36, 3 December 2016 (UTC) + ::: [[fan club]] also shows some grammatical errors- his pronunciation of Twizzlers and his shortening of "fan fiction". I don't know how we would connect the nitpicking and the errors, but the two gags do seem to go hand in hand. [[Special:Contributions/50.206.151.149|50.206.151.149]] 16:38, 7 December 2016 (UTC) + ::::Okay, I get the Strong Sad Correcting People thing. Still not sold on the grammatical errors. The "Twizzlers" thing isn't a grammar error so much as a weird pronunciation befitting of a Homestar Runner cartoon... "fanfic" ''could'' be considered an error, but it's a common abbreviation that Strong Bad just doesn't like. Not sure if it counts. {{User:SRMX12/sig}} 16:55, 7 December 2016 (UTC) + + ==Error, New Design Change, or Part of Costume?== + I'm just now noticing The Knight's visor slats are blue instead of the standard yellow, along with shading added to them. Since this is his as-of-date most recent appearance, and the design choice doesn't really seem to relate to the costume in any way, should this be considered an error for him, or part of a design evolution? --[[User:ZootyCutie|ZootyCutie]] 23:57, 4 August 2019 (UTC)
## Narrator
"The narrator at the end, as well as his rhyming cadence and the background organ music, is a reference to the Ghost Host of Disney's Haunted Mansion."
Really? It seemed like a blatant reference to Vincent Price in Micheal Jackson's Thriller. — 73.11.214.10 (Talk | contribs) 03:29, 30 October 2015 (left unsigned)
## Title of the episode
If you try to share the link to the Homestar Page, it titles the episode as "St. Cadaverstump's Home for Wayward Sbemails" & not "The House That Gave Sucky Tricks." — 73.11.214.10 (Talk | contribs) 03:32, 30 October 2015 (left unsigned)
That's because when you share a link, it takes the page title in the tab at the top. - Catjaz63 04:02, 30 October 2015 (UTC)
## TiVo?
Does anyone think we should add that Strong Mad is dressed up like a TiVo? 67.243.54.46 02:08, 31 October 2015
The House That Gave Sucky Tricks Costumes. 02:42, 31 October 2015 (UTC)
## The Goblin
The Goblin is not in this cartoon. 76.102.80.126 18:14, 2 November 2015 (UTC)
Yes. And? He's also not in The House That Gave Sucky Treats, Halloween Fairstival, Doomy Tales of the Macabre, or I Killed Pom Pom. --Jay stuck at home (Talk) 23:27, 2 November 2015 (UTC)
## Marizpan's shoes
Is it worth pointing out that in the pile of shoes are a pair of distinctly marizpan looking shoes, suggesting that she regularly wears shoes like that?--14.200.191.4 22:28, 2 November 2015 (UTC)
That's speculation; which is not something we document. - Catjaz63 22:42, 2 November 2015 (UTC)
Actually, it's not speculation at all, it's a reference to the running gag about Marzipan's legs and warrants inclusion both here and there. — Defender1031*Talk 02:19, 6 November 2015 (UTC)
## "A 220 in four-fourty-five"
Could we get an Explanation on this? Is "220 in 4:45" even remotely impressive? — 24.6.5.112 (Talk | contribs) 20:40, 4 November 2015 (left unsigned)
## Horror Experience Room
The whole "immersive horror experience room" is at least a reference to Race to Escape (complete with ridiculous leaps in logic). — 74.212.42.241 (Talk | contribs) 20:31, 5 November 2015 (left unsigned)
And other things of that nature. There are many such things in existence. — Defender1031*Talk 20:52, 5 November 2015 (UTC)
## The New Face of Terror
Is it me, or is Large Bean a dead-on parody of Slenderm'n? The design is similar, they are both "unsettling" rather than graphic, and they both have become popular enough to warrant plush toys (which are even closer in design).
And if you want to get really nit-picky, the scene keeps jump-cutting between the room itself and Strong Bad watching on a live feed, where there is a small amount of static.
Yeah, that last one was a stretch... But still. And I'm aware that this is now a controversial topic, but if the toon is referencing it then it should be added. -- PURPLE WRENCH 17:13, 10 November 2015 (UTC)
## Just a Gigolo
• When Strong Bad says "Why if I had a haunted house, I think it would turn out a little something..." could be a reference to David Lee Roth's "Just a Gigolo" song and music video.
Could someone please explain which specific part of the music video this line "could" reference, since I haven't seen it myself? BBG 18:33, 11 November 2015 (UTC)
If noone knows the connection, and thus whether or not it seems that strong, does this entry still seem worth keeping on the toon's page? BBG 14:12, 18 November 2015 (UTC)
## I Wanna Speak To Cookie Puss, Man!
Could the KoT's Cookie Puss line be a reference to an early Beastie Boys number by the same name? I only ask because the Beasties are referenced multiple times throughout the site. YoghNess (Talk | contribs) 19:42, 17 November 2015 (left unsigned)
nope. — Defender1031*Talk 20:18, 17 November 2015 (UTC)
I know Cookie Puss is a real mascot, but this wouldn't be the first sneaky reference. [1] [2] [3] YoghNess
I don't know why you call those references "sneaky", but there's absolutely NOTHING here to suggest KoT is referring to anything other than the mascot. — Defender1031*Talk 16:01, 21 November 2015 (UTC)
## Beetlejuice Cartoon, maybe?
I'm curious if Homestar's song might be a reference to an old episode of the Beetlejuice animated series which took place on a tropical island and ended with the same "Da-bo-dee-bo-da!" scat song. — 184.59.149.197 (Talk | contribs) 19:08, 25 November 2015 (left unsigned)
Given that he's already mentioned Beetlejuice, it's likely, but we'll need a direct reference to a specific episode rather than a vague description of one. — Defender1031*Talk 12:29, 26 November 2015 (UTC)
Season 1 Episode 18, Quit while you're a head. I just looked up the episode on dailymotion. Skip to about the 22:00 mark. — 184.59.149.197 (Talk | contribs) 21:17, 6 December 2015 (left unsigned)
That certainly seems like a direct reference. DEI DAT VM 12:44, 7 December 2015 (UTC)
## Strong Sad's nitpicking?
I've noticed a trend of Strong Sad correcting people (Pseudonym, anyone?) - should this be noted as a running gag or just a facet of his personality on his own article? Perhaps it could be paired with those times he's grammatically wrong, as that seems to be part of the joke- a pretentious know-it-all who frequently makes his own mistakes. 50.206.151.149 16:50, 2 December 2016 (UTC)
Interesting idea. Can you give other examples besides this toon and secret identity? Or examples of when he's grammatically wrong? (I can't think of many of those.) I'm not sure if it would qualify as a page-able running gag, but maybe we should note it on his page. Lira (talk) 18:25, 2 December 2016 (UTC)
Strong Sad is the Strong Bad Email police. Strong Sad complained that both 5" and 3 1/2" disks are both floppies and that Strong Bad's octopus-toss was a change-up, not a curveball. That's three Strong Bad Emails in a row. Not to mention that you get an achievement in Homestar Ruiner for getting Strong Sad to show up an nitpick about lemmings and such. 99.48.86.26 00:36, 3 December 2016 (UTC)
fan club also shows some grammatical errors- his pronunciation of Twizzlers and his shortening of "fan fiction". I don't know how we would connect the nitpicking and the errors, but the two gags do seem to go hand in hand. 50.206.151.149 16:38, 7 December 2016 (UTC)
Okay, I get the Strong Sad Correcting People thing. Still not sold on the grammatical errors. The "Twizzlers" thing isn't a grammar error so much as a weird pronunciation befitting of a Homestar Runner cartoon... "fanfic" could be considered an error, but it's a common abbreviation that Strong Bad just doesn't like. Not sure if it counts. Lira (talk) 16:55, 7 December 2016 (UTC)
## Error, New Design Change, or Part of Costume?
I'm just now noticing The Knight's visor slats are blue instead of the standard yellow, along with shading added to them. Since this is his as-of-date most recent appearance, and the design choice doesn't really seem to relate to the costume in any way, should this be considered an error for him, or part of a design evolution? --ZootyCutie 23:57, 4 August 2019 (UTC) | 3,749 | 13,224 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.640625 | 3 | CC-MAIN-2020-40 | latest | en | 0.917766 |
http://mathhelpforum.com/differential-equations/213686-graphing-euler-s-method.html | 1,481,210,075,000,000,000 | text/html | crawl-data/CC-MAIN-2016-50/segments/1480698541529.0/warc/CC-MAIN-20161202170901-00361-ip-10-31-129-80.ec2.internal.warc.gz | 180,597,092 | 10,420 | # Thread: Graphing and Euler's Method
1. ## Graphing and Euler's Method
Hi,
Part "a" of my problem says
"Let y = y(x) be the solution to the initial-value problem
y' = x^2 - y/3, y=y(x), y(1)=0
Use Euler's method with n = 3 steps to estimate the value of y(2) show your steps clearly..."
Anyway, I found the values and they are correct, shown below,
x_0 = 1
y_0 = 0
x_1 = 4/3
y_1 = 1/3
x_2 = 5/3
y_2 = 8/9
x_3 = 2
y_3 = 139/81
But my problem is with part b,
It' asking me to graph my values with the graph of the actual solution, which isn't given. How am I supposed to figure out what the actual solution looks like?
Thanks
2. ## Re: Graphing and Euler's Method
The problem does not ask you to draw the graph of the actual solution. It asks you to write the "primary relation" of the graph of the approximation to the graph of the solution. If what is below the picture is the answer, then it seems that the "primary relation" is that the first segment of the approximation is tangent to the graph of the solution.
You can see the solution in WolframAlpha.
3. ## Re: Graphing and Euler's Method
Oh wow that is easy then, thank you
But what does the "primary" in "primary relation" mean? | 350 | 1,204 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.640625 | 4 | CC-MAIN-2016-50 | longest | en | 0.919491 |
https://helpingwithmath.com/weight-volume-measurement-issues/ | 1,721,065,327,000,000,000 | text/html | crawl-data/CC-MAIN-2024-30/segments/1720763514713.2/warc/CC-MAIN-20240715163240-20240715193240-00565.warc.gz | 268,621,617 | 26,876 | Home » Math Theory » Weight & Volume Measurement Issues
Note: this page contains legacy resources that are no longer supported. You are free to continue using these materials but we can only support our current worksheets, available as part of our membership offering.
# Weight & Volume Measurement Issues
Students are typically introduced to volume and weight measurement in 3rd grade. The following guidance is common to both. There is also specific guidance and worksheets for weight and for volume – see the two links below.
## Conservation
Conservation of quantities means understanding that changing the shape, position, or placing quantities in different containers does not change the quantity. For example, when modeling with clay, the volume and weight will stay the same regardless of the shape or when pouring the contents of a small cup into a larger cup the volume contained is the same in both cups. Children acquire this understanding as they develop and most will have done so by 3rd grade. Nevertheless, you should check that your children understand it.
## Mistaking Weight For Volume
The measurement of volume and weight are often introduced close together and this can increase the likelihood of your children confusing one for the other. Be aware of this possibility and discuss and provide examples of both that are familiar to your children.
## Volume and Capacity & Weight and Mass
The terms weight and mass are often used interchangeably although they do have different meanings. The same applies to volume and capacity. HelpingWithMath.com generally uses volume and weight but check with your children’s school to ensure the terms you use do not lead to confusion.
## Other Systems of Measurement
The Measurement section on this site focuses on the metric system of measurement. Depending on where you live, you and your children may regularly encounter the United States customary units or the closely-related Imperial Measurement System. These include ounces, pounds, gallons, quarts, inches, feet, yards and miles to name only a few. | 384 | 2,074 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.734375 | 4 | CC-MAIN-2024-30 | latest | en | 0.940598 |
https://www.esaral.com/q/find-the-cartesian-equations-of-the-line-which-passes-through-the-point-33974 | 1,712,925,367,000,000,000 | text/html | crawl-data/CC-MAIN-2024-18/segments/1712296815919.75/warc/CC-MAIN-20240412101354-20240412131354-00876.warc.gz | 685,739,016 | 11,438 | # Find the Cartesian equations of the line which passes through the point
Question:
Find the Cartesian equations of the line which passes through the point $(1,3,-2)$ and is parallel to the line given by $\frac{\mathrm{x}+1}{3}=\frac{\mathrm{y}-4}{5}=\frac{\mathrm{z}+3}{-6}$. Also, find the vector form of the equations so obtained.
Solution: | 94 | 346 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.765625 | 3 | CC-MAIN-2024-18 | longest | en | 0.876246 |
https://healthfully.com/calculate-physical-activity-level-7264020.html | 1,726,373,387,000,000,000 | text/html | crawl-data/CC-MAIN-2024-38/segments/1725700651614.9/warc/CC-MAIN-20240915020916-20240915050916-00334.warc.gz | 268,024,618 | 52,524 | # How to Calculate Physical Activity Level
A person's physical activity level is a numeric method of expressing one's daily energy expenditure. Which is to say, it's a number given to what is done in a day. The amount of physical exertion in one day determines how many calories must be consumed in the same period to maintain activity and lose or gain weight as desired. Physical activity level (PAL) takes into account total daily energy expenditure (TDEE) and basal metabolic rate (BMR). The equation can be written as:
PAL = TDEE / BMR
Calculate BMR.
An accurate calculation of BMR can only be done through specifically designed tests conducted when the digestive system is inactive (after 8 hours of sleep, 12 hours without food). Without proper testing the BMR can only be estimated, with the closest approximation coming from the Harris-Benedict equation, which was once the standard for BMR measurements but has since been proven to overestimate by 5 percent or more. Considering the number of factors which are involved in proper BMR calculation, including body surface area, body temperature and health, external temperature and gland function, completely precise BMR results can't be done in a simple equation, however, Harris-Benedict remains the best practical estimation available without proper testing. The equations use the variable of weight (w) in kilograms, height (h) in centimeters and age (a).
For men: BMR = (13.75 x w) + (5 x h) - (6.76 x a) + 66
For women: BMR = (9.56 x w) + (1.85 x h) - (4.68 x a) + 655
### How to Check Your Weight Without a Scale
Calculate TDEE.
TDEE takes into account the number of calories used in day both at rest (BMR) and during physical activities. Again, accurate rating uses height, weight, age, body type and gender. Devices such a pedometer (which counts the number of steps taken in a day) can be used to reasonably determine TDEE. There are also tests, such as the double-labeled water test which estimates the amount of carbon dioxide and water the body produces over the course of two to three weeks. Rough equations for TDEE (as a measurement of calories used) can be attained through the following equations:
For sedentary people (office workers who rarely or never exercise): TDEE = weight (in pounds) x 14
For moderately active people (construction workers, those who exercise or play a sport 3 to 5 times a week): TDEE = weight (lbs) x 17
For active people (agricultural workers, those who exercise or play a sport daily): TDEE = weight (lbs) x 20
Place TDEE and BMR into the equation for physical activity level (PAL). General activity levels are expressed as:
Inactive: less than 1.4
Sedentary: 1.4 - 1.69
Moderately active: 1.70 - 1.99
Vigorously active: 2 - 2.4
Extremely active: greater than 2.4 | 672 | 2,785 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.578125 | 4 | CC-MAIN-2024-38 | latest | en | 0.925094 |
http://nasawavelength.org/resource-search?facetSort=1&topicsSubjects=Mathematics%3AGeometry&instructionalStrategies%5B%5D=Generating+and+testing+hypotheses&instructionalStrategies%5B%5D=Guided+inquiry | 1,438,435,655,000,000,000 | text/html | crawl-data/CC-MAIN-2015-32/segments/1438042988650.6/warc/CC-MAIN-20150728002308-00146-ip-10-236-191-2.ec2.internal.warc.gz | 168,286,444 | 13,458 | ## Narrow Search
Audience
Topics
Earth and space science
Mathematics
Resource Type [-]
View more...
Learning Time
Materials Cost
Instructional Strategies [-]
View more...
SMD Forum
Filters: Your search found 9 results.
Topics/Subjects:
Geometry
Instructional Strategies:
Generating and testing hypotheses
Guided inquiry
Sort by:
Per page:
Now showing results 1-9 of 9
# Oh, What a Pane!
Math skills are applied throughout this investigation of windows. Starting with basic window shapes, students determine area and complete a cost analysis, then do the same for windows of unconventional shapes. Students will examine photographs taken... (View More)
Audience: Elementary school, Middle school, High school
Materials Cost: Free
# Snow is a Form of Ice
This is a lesson about condensation, snow and snowflakes. Learners will investigate how water and ice exist in the atmosphere as they study water vapor condensing, find that clouds are made of tiny droplets of water, and notice that snow forms in... (View More)
# My Angle on Cooling: Effect of Distance and Inclination
This is a detailed lesson about heat transfer and distance. Learners will design and conduct experiments to answer the question, "how does distance and inclination affect the amount of heat received from a heat source?" They will measure heat change... (View More)
# Guess my Shape (Grades 2-4)
In this inquiry investigation, students explore how light hits things of different shape and form. One real world application to this activity is understanding what we actually observe when we see a solar eclipse. Supplies needed for this lesson... (View More)
# Guess my Shape (Grades 4-6)
In this inquiry investigation, students explore how light hits things of different shape and form. One real world application to this activity is understanding what we actually observe when we see a solar eclipse. Supplies needed for this lesson... (View More)
# Guess my Shape (K-2)
In this inquiry investigation, students explore how light hits things of different shape and form. One real world application to this activity is understanding what we actually observe when we see a solar eclipse. Supplies needed for this lesson... (View More)
# Diameter of the Moon
This is an activity about the size of the Moon. Learners will calculate the diameter of the Moon using proportions. This activity is in Unit 1 of the "Exploring the Moon" teachers guide, which is designed for use especially, but not exclusively,... (View More)
# Atrapando Luz
This is an activity about telescopes. Learners will first measure several circles to determine their diameters and calculate their areas. Afterwards, they will cover each circle entirely with pennies and record how many pennies are needed for each... (View More)
# Light Collecting Model
This is an activity about telescopes. Learners will first measure several circles to determine their diameters and calculate their areas. Afterwards, they will cover each circle entirely with pennies and record how many pennies are needed for each... (View More)
1 | 637 | 3,078 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.0625 | 3 | CC-MAIN-2015-32 | longest | en | 0.88771 |
https://physics.stackexchange.com/questions/611937/a-black-hole-has-no-hair-but-can-it-have-cellulite | 1,721,680,723,000,000,000 | text/html | crawl-data/CC-MAIN-2024-30/segments/1720763517915.15/warc/CC-MAIN-20240722190551-20240722220551-00102.warc.gz | 387,704,680 | 39,990 | # A black hole has no hair, but can it have cellulite?
A well known conjecture of general relativity is that a "black hole has no hair", i.e. once matter has disappeared behind the event horizon, the information about what detailed properties this matter had (except mass, (angular)momentum and charge), before it went into the hole, is thought to be lost.
But I was asking myself if a black hole does, from the outset, have a spherical event horizon and an essential singularity in the center, or if the event horizon can experience dynamic surface waves ("cellulite" to put it pointedly) and if the interior solution could have no singularity at all (because the matter that collapsed inside the horizon is still falling to the center). In this picture, I would expect the spherically symmetric solution to be the equilibrium state of the black hole when all surface waves have been dissipated to the surroundings and all matter inside of it has fallen to the center.
Is this picture incorrect?
• Related: physics.stackexchange.com/q/937/123208 I quite like this line from Stan Liou's answer: "rather than gravity having a special property that enables it to cross the horizon, in a certain sense gravity can't cross the horizon, and it is that very property that forces gravity outside of it to remain the same". Commented Feb 2, 2021 at 16:45
• @PM2Ring: but that property does not enforce a strictly spherically symmetric gravitational field outside the hole. The black hole exterior is subject to boundary conditions, just like any other gravitational field. So my question basically boils down to: can the event horizon strictly be homogeneous as a spherical boundary condition when the volume in its direct vicinity is filled with arbitrarily complex fields. Or, put as an electromagnetic analogy: the electric fields outside a spherical conductor determine the charge distribution on its surface and vice versa. If and why not for gravity? Commented Feb 2, 2021 at 17:07
• " that property does not enforce a strictly spherically symmetric gravitational field" That's true, but there's bound to be at least a high degree of circular symmetry, due to the angular momentum. Commented Feb 2, 2021 at 17:37 | 471 | 2,214 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.6875 | 3 | CC-MAIN-2024-30 | latest | en | 0.938884 |
myshotlists.com | 1,696,315,664,000,000,000 | text/html | crawl-data/CC-MAIN-2023-40/segments/1695233511055.59/warc/CC-MAIN-20231003060619-20231003090619-00555.warc.gz | 456,314,566 | 15,821 | “IF” Gambling bets and Reverses
I actually mentioned last week, that if your book offers “if/reverses, inch you could play those rather than parlays. Several of may very well not know how to wager an “if/reverse. inches A complete explanation and comparison of “if” bets, “if/reverses, ” and even parlays follows, together with the scenarios in which each and every is best..
ufa เว็บตรง “if” bet is usually exactly what this sounds like. You bet Team A and IF it wins then you certainly place an equivalent amount on Group B. A parlay with two games going off at different times will be a type of “if” guess in which you bet on the subject of the first staff, and if this wins you bet double on typically the second team. Together with a true “if” bet, instead associated with betting double in the second group, you bet the same amount on the particular second team.
A person can avoid 2 calls towards the terme conseillé and lock in the particular current line on the later game simply by telling your terme conseillé you want to make an “if” bet. “If” bets can also always be made on 2 games starting from the same moment. The bookmaker will certainly wait until the initial game is above. In the event the first sport wins, he may put the same quantity on the next game even nevertheless it has already been enjoyed.
Although an “if” bet is really 2 straight bets at normal vig, an individual cannot decide later on that you zero longer want the particular second bet. After you make an “if” bet, the 2nd bet should not be cancelled, even if the particular second game provides not gone away yet. In case the primary game wins, a person will have activity on the second sport. Because of this, there will be less control over a good “if” bet than over two straight bets. Once the two games without a doubt overlap in time, nevertheless , the only approach to bet one particular only if one more wins is by simply placing an “if” bet. Of program, when two game titles overlap with time, cancelling technology of the second of all game bet is just not an issue. This should be mentioned, that when the 2 games from distinct times, most training books will not allow you to fill in the second game later on. You must specify both teams once you make the gamble.
You can make an “if” bet by thinking to the bookmaker, “I want to make a great ‘if’ bet, inch and then, “Give me Team Some sort of IF Team N for \$100. inches Giving your terme conseillé that instruction will be the same as gambling \$110 to triumph \$100 on Crew A, and and then, only if Staff A wins, gambling another \$110 to be able to win \$100 about Team B.
In the event the first team in the “if” bet will lose, there is simply no bet within the second team. No matter if the particular second team wins of loses, the total loss on the “if” bet will be \$110 when a person lose on the particular first team. If the first staff wins, however, you would probably have a gamble of \$110 in order to win \$100 moving on the 2nd team. In that circumstance, in case the second crew loses, your complete loss would become just the 10 dollars of vig for the split of the particular two teams. In case both games succeed, you would probably win hundred buck on Team A new and \$100 on Team B, regarding a total earn of \$200. As a result, the maximum reduction on an “if” will be \$110, plus the maximum succeed would be \$200. This is well-balanced from the disadvantage of losing the entire \$110, instead of simply \$10 of vig, each and every time the teams split with the very first team in the wager losing.
From this article you can see, that matters a great deal which game you put initial in an “if” bet. If you position the loser first of all within a split, after that you lose your current full bet. In the event that you split but the loser is the second team in the bet, and then you only shed the vig.
Gamblers soon discovered that the right way to avoid typically the uncertainty brought on by the order of is victorious and loses is to make two “if” bets adding each team initial. Instead of gambling \$110 on inches Team A in the event that Team B, ” you would bet merely \$55 on very well Team A in the event that Team B. inches make a second “if” bet solving the order involving the teams for another \$55. The second bet would set Team B initial and Team A second. This kind of double bet, reversing the order of the identical a couple of teams, is known as a great “if/reverse” or sometimes just a “rever | 1,031 | 4,498 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.5625 | 3 | CC-MAIN-2023-40 | longest | en | 0.956248 |
https://mail.python.org/pipermail/tutor/2003-November/026394.html | 1,560,865,957,000,000,000 | text/html | crawl-data/CC-MAIN-2019-26/segments/1560627998724.57/warc/CC-MAIN-20190618123355-20190618145355-00235.warc.gz | 523,135,127 | 2,320 | # [Tutor] double result ... [home on the range()]
Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sun Nov 16 17:27:26 EST 2003
```
On Sun, 16 Nov 2003, Tadey wrote:
> >>> a=7
> >>> b=9
> >>> c=8
> >>> for i in range(a,b,c):
> >>> print i
> ...
> ...
> 7
>
>
> ... gives value a, becuse it is the first value in the row, and because
> a, b, c are no "logical sequence" for computer (it doesn't support
> alphabet) !!
Ah! range() is a sequence builder, but it's not the only one --- you can
directly build sequences by using lists:
###
>>> [3, 7, 19, 42]
[3, 7, 19, 42]
>>>
>>>
>>> mylist = [7, 9, 8]
>>> mylist
[7, 9, 8]
>>> mylist[0]
7
>>> mylist[1]
9
###
But range() is meant to make it easy to generate lists of ascending
numbers:
###
>>> range(10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> range(10, 20)
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
>>> range(10, 20, 3)
[10, 13, 16, 19]
###
So those numbers that we feed it are meant to be used as "endpoints" of a
number range.
range() can take in either one, two, or three arguments, and it behaves
slightly differently in each case. The third case is asking Python: "Give
me the range of numbers between 10 and 20, by skipping foward three
numbers at a time."
Once we understand range(), then it should be easier to see why:
range(7, 9, 8)
is only giving us
[7]
--- There's only one number between 7 and 9, if we skip 8 numbers forward
at a time.
But if we try getting the numbers from 10 to 0, by stepping forward 1
at a time, we're sunk:
###
>>> range(10, 0, 1)
[]
###
But, by the way, we can go "backwards", just as long as the step is
negative:
###
>>> range(10, 0, -1)
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
### | 615 | 1,669 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.703125 | 4 | CC-MAIN-2019-26 | latest | en | 0.897233 |
http://www.gurufocus.com/term/ev2ebitda/ACI/EV%252FEBITDA/Arch%2BCoal%2BInc | 1,427,569,988,000,000,000 | text/html | crawl-data/CC-MAIN-2015-14/segments/1427131297689.58/warc/CC-MAIN-20150323172137-00241-ip-10-168-14-71.ec2.internal.warc.gz | 518,968,720 | 26,167 | Switch to:
Arch Coal Inc (NYSE:ACI)
EV/EBITDA
15.88 (As of Today)
EV/EBITDA ratio is calculated as enterprise value divided by its EBITDA. As of today, Arch Coal Inc's enterprise value is \$4,399 Mil. Arch Coal Inc's earnings before depreciation and amortization for the trailing twelve months (TTM) ended in Dec. 2014 was \$277 Mil. Therefore, Arch Coal Inc's EV/EBITDA ratio for today is 15.88.
EV/EBITDA (Enterprise value/EBITDA) is a valuation multiple used in finance and investment to measure the value of a company. This important multiple is often used in conjunction with, or as an alternative to, the P/E Ratio to determine the fair market value of a company.
As of today, Arch Coal Inc's stock price is \$1.04. Arch Coal Inc's earnings per share for the trailing twelve months (TTM) ended in Dec. 2014 was \$-2.64. Therefore, Arch Coal Inc's P/E Ratio for today is .
The "classic" EV/EBITDA ratio is much better in capturing debt and net cash than the P/E Ratio.
Definition
Arch Coal Inc's EV/EBITDA for today is calculated as:
EV/EBITDA = Enterprise Value (Today) / Earnings Before Depreciation and Amortization (TTM) = 4399.123 / 276.975 = 15.88
Arch Coal Inc's current Enterprise Value is \$4,399 Mil.
Arch Coal Inc's Earnings Before Depreciation and Amortization for the trailing twelve months (TTM) ended in Dec. 2014 was 33.144 (Mar. 2014 ) + 68.695 (Jun. 2014 ) + 71.804 (Sep. 2014 ) + 103.332 (Dec. 2014 ) = \$277 Mil.
* All numbers are in millions except for per share data and ratio. All numbers are in their own currency.
Explanation
EV/EBITDA (Enterprise value/EBITDA) is a valuation multiple used in finance and investment to measure the value of a company. This important multiple is often used in conjunction with, or as an alternative to, the P/E Ratio to determine the fair market value of a company.
Arch Coal Inc's P/E Ratio for today is calculated as:
P/E Ratio = Share Price (Today) / Earnings Per Share (TTM) = 1.04 / -2.641 =
Arch Coal Inc's share price for today is \$1.04.
Arch Coal Inc's Earnings Per Share for the trailing twelve months (TTM) ended in Dec. 2014 was -0.59 (Mar. 2014 ) + -0.46 (Jun. 2014 ) + -0.46 (Sep. 2014 ) + -1.131 (Dec. 2014 ) = \$-2.64.
* All numbers are in millions except for per share data and ratio. All numbers are in their own currency.
Study has found that the companies with the lowest EV/EBITDA outperforms companies measured as cheap by other ratios such as P/E Ratio.
Please read Which price ratio outperforms the enterprise multiple?
Related Terms
Historical Data
* All numbers are in millions except for per share data and ratio. All numbers are in their own currency.
Arch Coal Inc Annual Data
Dec05 Dec06 Dec07 Dec08 Dec09 Dec10 Dec11 Dec12 Dec13 Dec14 ev2ebitda 20.35 10.20 16.37 4.45 12.26 10.25 8.10 -25.33 -19.64 16.45
Arch Coal Inc Quarterly Data
Sep12 Dec12 Mar13 Jun13 Sep13 Dec13 Mar14 Jun14 Sep14 Dec14 ev2ebitda 17.19 -25.33 -14.84 23.07 -30.05 -19.64 -17.51 -16.24 -41.75 16.45
Get WordPress Plugins for easy affiliate links on Stock Tickers and Guru Names | Earn affiliate commissions by embedding GuruFocus Charts
GuruFocus Affiliate Program: Earn up to \$400 per referral. ( Learn More) | 912 | 3,204 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.640625 | 3 | CC-MAIN-2015-14 | longest | en | 0.930065 |
https://math.answers.com/Q/What_is_the_smallest_2_digit_number_you_can_round_up_to_hundreds | 1,716,363,498,000,000,000 | text/html | crawl-data/CC-MAIN-2024-22/segments/1715971058534.8/warc/CC-MAIN-20240522070747-20240522100747-00891.warc.gz | 339,331,016 | 47,414 | 0
# What is the smallest 2 digit number you can round up to hundreds?
Updated: 9/24/2023
Wiki User
7y ago
50
Wiki User
7y ago
Earn +20 pts
Q: What is the smallest 2 digit number you can round up to hundreds?
Submit
Still have questions?
Related questions
1,450
### How do you round 3295 to the nearest thousand?
The digit in the hundreds is a 2, so we round the number down to get 3000 as the answer.
It is 8999950.
### What is the smallest number that round to 500 when rounded by 100?
The smallest number that rounds up to 500 when you're rounding by hundreds would be 450.
### How do you round 409614 to the nearest thousand?
The digit in the hundreds position is a 6, so it will round the number up, leaving 410000 as the answer.
### What is smallest and large whole number that round off 600000 to the nearest hundreds?
They are 599950 and 600050.
### What is the least possible number that can be rounded to 200?
If you are rounding to the hundreds then 150 will be the smallest number that will round to 200.
### How do you round 2176 to the nearest thousand?
The digit in the hundreds place is 1, so we round the number down to give 2000 as the answer.
900
### How do you round 1226 to the nearest 100?
Look at the digit after the hundreds position in the tens position. It is a 2. That will round the number down. So the answer will be 1200.
### What is 13145978 rounded to nearest 1000?
To round a number to the nearest thousand, you need to look at the hundreds digit and decide whether to round up or down. If the hundreds digit is 5 or more, you round up. If it is 4 or less, you round down. For example: 13145978 has a hundreds digit of 9, which is more than 5, so you round up to the next thousand: 13146000. 13145478 has a hundreds digit of 4, which is less than 5, so you round down to the previous thousand: 13145000. You can use the rounding calculator to check your answers or try different rounding modes and levels of precision.
### How do you round 22076 to the nearest 1000?
The digit in the hundreds position is 0, so the number rounds down to 22000. | 547 | 2,104 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 4.09375 | 4 | CC-MAIN-2024-22 | latest | en | 0.890452 |
http://www.britannica.com/EBchecked/topic/559668/spherical-triangle | 1,432,898,409,000,000,000 | text/html | crawl-data/CC-MAIN-2015-22/segments/1432207929978.35/warc/CC-MAIN-20150521113209-00159-ip-10-180-206-219.ec2.internal.warc.gz | 341,195,828 | 10,927 | # Spherical triangle
Mathematics
Thank you for helping us expand this topic!
Once you are finished and click submit, your modifications will be sent to our editors for review.
This topic is discussed in the following articles:
• ## definition by Menelaus
Menelaus of Alexandria
Greek mathematician and astronomer who first conceived and defined a spherical triangle (a triangle formed by three arcs of great circles on the surface of a sphere).
trigonometry: Passage to Europe
Until the 16th century it was chiefly spherical trigonometry that interested scholars—a consequence of the predominance of astronomy among the natural sciences. The first definition of a spherical triangle is contained in Book 1 of the Sphaerica, a three-book treatise by Menelaus of Alexandria (c. ad 100) in which Menelaus developed the spherical equivalents of...
• ## place in spherical trigonometry
trigonometry: Spherical trigonometry
Spherical trigonometry involves the study of spherical triangles, which are formed by the intersection of three great circle arcs on the surface of a sphere (see the figure). Spherical triangles were subject to intense study from antiquity because of their usefulness in navigation, cartography, and astronomy. (See the section Passage to Europe.)
MLA style:
"spherical triangle". Encyclopædia Britannica. Encyclopædia Britannica Online.
Encyclopædia Britannica Inc., 2015. Web. 29 May. 2015
<http://www.britannica.com/EBchecked/topic/559668/spherical-triangle>.
APA style:
Harvard style:
spherical triangle. 2015. Encyclopædia Britannica Online. Retrieved 29 May, 2015, from http://www.britannica.com/EBchecked/topic/559668/spherical-triangle
Chicago Manual of Style:
Encyclopædia Britannica Online, s. v. "spherical triangle", accessed May 29, 2015, http://www.britannica.com/EBchecked/topic/559668/spherical-triangle.
While every effort has been made to follow citation style rules, there may be some discrepancies.
Please refer to the appropriate style manual or other sources if you have any questions.
Click anywhere inside the article to add text or insert superscripts, subscripts, and special characters.
You can also highlight a section and use the tools in this bar to modify existing content:
Editing Tools:
We welcome suggested improvements to any of our articles.
You can make it easier for us to review and, hopefully, publish your contribution by keeping a few points in mind:
1. Encyclopaedia Britannica articles are written in a neutral, objective tone for a general audience.
2. You may find it helpful to search within the site to see how similar or related subjects are covered.
3. Any text you add should be original, not copied from other sources.
4. At the bottom of the article, feel free to list any sources that support your changes, so that we can fully understand their context. (Internet URLs are best.)
Your contribution may be further edited by our staff, and its publication is subject to our final approval. Unfortunately, our editorial approach may not be able to accommodate all contributions.
MEDIA FOR:
spherical triangle
Citation
• MLA
• APA
• Harvard
• Chicago
Email
You have successfully emailed this.
Error when sending the email. Try again later. | 720 | 3,214 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.953125 | 3 | CC-MAIN-2015-22 | latest | en | 0.85344 |
http://mathhelpforum.com/calculus/220680-consevative-field-hep-print.html | 1,526,818,911,000,000,000 | text/html | crawl-data/CC-MAIN-2018-22/segments/1526794863410.22/warc/CC-MAIN-20180520112233-20180520132233-00066.warc.gz | 194,758,381 | 2,830 | # consevative field hep
• Jul 18th 2013, 04:14 PM
n22
consevative field hep
Okay, have you not tried this yourself? The standard calculation for $\displaystyle \nabla\times G$ is $\displaystyle \left|\begin{array}{ccc}\vec{i} & \vec{j} & \vec{k} \\ \frac{\partial}{\partial x} & \frac{\partial}{\partial y} & \frac{\partial}{\partial z} \\ 2xyz & x^2z+2y & x^2y- 2z \end{array}\right|$. You knew that didn't you? The result is is very simple as you should suspect because the next part is "show that G is a conservative field". What must be true of $\displaystyle \nabla\times G$ in order that the field be conservative? And what is true about the work done in moving an object around a closed path in a conservative force field? | 219 | 730 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.515625 | 3 | CC-MAIN-2018-22 | latest | en | 0.871484 |
https://quant.stackexchange.com/tags/risk-management/hot | 1,725,847,939,000,000,000 | text/html | crawl-data/CC-MAIN-2024-38/segments/1725700651053.52/warc/CC-MAIN-20240909004517-20240909034517-00833.warc.gz | 443,332,172 | 25,789 | # Tag Info
### Quantifying climate change risk
Here are some resources that I found useful when learning about this subject, in which I'm very interested. (Some may be more general ESG than just just climate.) Citigroup. Environmental and Social ...
• 12.6k
Accepted
### Intuitive explanation for expectiles
No reply has been given so I wanted to at least give a visualisation of the expectiles. Suppose the curvy dashed line in my picture represents a cumulative distribution function of some random ...
• 1,527
Accepted
• 6,994
Accepted
• 4,358
### Hierarchical Risk Parity with allocation constraints?
EDITED You are right. We have to look town to the "leaves" in each iteration. I would do it the following way: If $L_i^{(j)}$ is the set of indices in the $j$ branch ($j \in \{1,2\}$), then we ...
• 2,935
### Intuitive explanation for expectiles
That picture in the other answer is pretty slick (+1), so I will just add a note on why one can interpret the colors of those areas like that: Blue: Define $Y = (X-x)_+$. This is nonnegative r.v., ...
• 554
Accepted
### Does longer time horizon necessarily imply reduced risk?
It depends upon how you define risk. Assume a constant, positive equity risk premium and an equity index following geometric Brownian motion (GBM): d \log S_t = \mu \, dt + \sigma \, dZ_t = (\hat{\...
• 3,700
Accepted
### Structured product sellers and div swaps
The paper is generally correct, but it is not a general statement, as in a general truth of options hedging in a theoretical context, rather a statement regarding how the structured derivs market is ...
• 1,406
### Structured product sellers and div swaps
To add to the above on a more practical note: In general, SP desks make money on the individual product when the underlying declines. Dividends make the underlying decline, hence they are naturally ...
• 161 | 454 | 1,870 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.734375 | 3 | CC-MAIN-2024-38 | latest | en | 0.876051 |
http://www.biologyjunction.com/environmental_ph.htm | 1,619,051,490,000,000,000 | text/html | crawl-data/CC-MAIN-2021-17/segments/1618039554437.90/warc/CC-MAIN-20210421222632-20210422012632-00319.warc.gz | 95,077,161 | 18,985 | # Environmental pH
Environmental pH
Casey Jones
Introduction:
A liquid may be an acid, base or neutral. The pH scale can be used to measure how acidic or basic a solution is. The scale is divided into three areas: Acid (readings below 7), neutral (reading of 7), and basic (readings above 7). Each division either increases or decreases the pH of a substance 10 times. The pH of 5 is ten times more acidic that a pH of 6. Water has a pH of 7, but when it mixes with air, the suspended materials will either raise or lower its pH. Acid Rain is an example of this type of reaction.
Hypothesis:
To determine the pH of various substances and their effect on organisms in the environment.
Materials:
The materials used in this lab were wide range pH paper with its corresponding pH chart, a spot plate, forceps, and 8 dropper bottles. Also used were soapy water, ammonia, lemon juice, cola, distilled water, pond water, vinegar, and baking soda.
Methods:
Using a spot plate, place a couple of drops of each solution into the numbered wells being careful not to mix the solutions. In well 1 place the soapy water, in well 2 place the lemon juice, in well 3 place ammonia, in will 4 place cola, in well 5 place distilled water, in well 6 place pond water, in well 7 place baking soda, and in well 8 place vinegar. Next, pick up a piece of pH paper with forceps and touch the paper to the liquid in well 1 and remove it. Then, compare it to the color of the pH paper to the pH color chart. Record the pH on the data table. After that use a new piece of pH paper each time, and repeat the steps in determining the pH of each solution recording all of them on the graph.
Results:
pH Table
Solutions pH Acidic Basic Neutral Soapy water 6 x Lemon Juice 2 x Ammonia 11 x Cola 3 x Distilled water 7 x Pond water 6 x Baking soda 6 x Vinegar 3 x
1. Which liquid had the lowest pH?
Lemon Juice
1. Which of the liquids had the highest pH?
Ammonia
1. Which of the liquids was closest to being neutral?
Distilled water
1. If the pH of a sample was 3, how many times more acidic is it than a solution with a pH of 6?
1000
1. How might some correct the ph of a lake with a reading of 3?
1. What would be the pH of human blood?
Its neutral
1. How does non-tearing shampoo work?
It’s neutral so it doesn’t irritate a person’s eye
1. What would be the likely pH of acid rain?
4
1. What industries in our area pump materials into the atmosphere to create a drastic change in rain water?
The paper mill
1. List any substance that had a pH that would cause tadpoles and fish to die.
Lemon juice, vinegar, and soda
Error Analysis:
The pH paper that was used was old and it didn’t give and accurate reading so another pH tester was used to find out which pH’s were off.
Discussion and Conclusion:
All fish die if the pH is 4.2 or lower. By looking at the data table you can see that if a fish was placed in lemon juice, cola, and vinegar the fish would die. So if you own a fish farm and rely on fish for a living you would have to make sure the pH of the water is above 5 on the pH scale, if the water was going below 5 you would want to add a basic chemical so it would even out the water to around a pH of 6 or 7. Also if you went trout fishing and you noticed that you saw a lot of dead fish floating in the water and wanted to know what the cause of the trout’s death was you could check the pH of the water. If the pH of the water was below 6 and you knew that trout died when the pH is 6 you would know the cause of their deaths. | 890 | 3,558 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 2.96875 | 3 | CC-MAIN-2021-17 | latest | en | 0.900752 |
https://www.math10.com/tests/fifth-grade-test-division-of-fractions-by-whole-numbers.html | 1,719,355,766,000,000,000 | text/html | crawl-data/CC-MAIN-2024-26/segments/1718198866422.9/warc/CC-MAIN-20240625202802-20240625232802-00694.warc.gz | 760,767,421 | 8,146 | # Multiplication and Division of Fractions by Whole Numbers
Complete the test and get an award.
Answers must be provided in simplified form.
For Example: 4/6 = 2/3
Question 1
$$\frac{1}{4} \times 2 = ?$$
Question 2
$$\frac{1}{2} \div 5 = ?$$
Question 3
$$\frac{3}{5} \times 2 = ?$$
Question 4
$$\frac{2}{4} \div 2 = ?$$
Question 5
$$\frac{3}{4} \div 3 = ?$$
Question 6
$$\frac{6}{9} \div 2 = ?$$
Question 7
$$\frac{3}{5} \times 6 = ?$$
Question 8
$$\frac{4}{5} \times 2 = ?$$
Question 9
$$\frac{4}{3} \div 10 = ?$$
Question 10
$$\frac{15}{4} \div 10 = ?$$
$$\frac{8}{4} \times 2 = ?$$
$$\frac{4}{9} \div 2 = ?$$ | 273 | 613 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.453125 | 3 | CC-MAIN-2024-26 | latest | en | 0.659152 |
https://mrslamar.com/math/perimeter-area/ | 1,501,253,399,000,000,000 | text/html | crawl-data/CC-MAIN-2017-30/segments/1500550969387.94/warc/CC-MAIN-20170728143709-20170728163709-00572.warc.gz | 685,042,555 | 30,581 | # Perimeter-Area
## Perimeter and Area
Interactive Pentominoes:
1. Scholastic– fill in the rectangle with the pentominoes
2. Pick an ANIMAL, then place the pentominoes
3. TeacherLed- ‘whiteboard’ pentominoes
4. Wales Gov’t Pentominoes series of lessons-
5. Perimeter & Area game– watch the mini tutorial first
LearnZillion & Other Resources:
AREA:
1. LZ: Use models to find the area of a rectangle (Area model)
2. LZ: Use the standard formula to find the area of a rectangle. (A=L x W)
3. LZ: Find the MISSING SIDE LENGTHS for a rectangle. (A= Length x Width)
PERIMETER:
1. LZ: Find the Perimeter of a polygon (the basics)
2. LZ: Perimeter strategy focus: add the lengths of the sides
3. LZ: Perimeter in a real world problem
4. LZ: Find Perimeter when side lengths are missing.
5. LZ: Find the perimeter of a shape that has more than 4 sides
6. LZ: Use a CHART to compare the same perimeter but different areas
7. LZ: Use a CHART to compare the same AREA but different perimeters
8. LZ: Find the missing side length by using the FORMULA for perimeter.
## Interactive Learning:
1. Area Shapes Shoot Game– Sheppard Software Site
2. PERIMETER shoot game- Sheppard Software Site
3. Birmingham Perimeter and Area – follow the directions, watch the quick tutorial, and try to solve the problems.
4. FUNBRAIN- area and perimeter picker game. Stay on this GAME ONLY. NO traveling to other games in Funbrain.
5. CYBERCHASE– build a ship with perimeter and area. PBS Kids
6. SHODOR Perimeter and Area Finder. This can get complicated, so read the directions carefully!
7. Funbrain perimeter and area game- STAY on this link!
8. DESIGN a PLAYground– You are given the area and perimeter of several objects to place in the party grid. You adjust the size and location of the objects by dragging the corners.
9. Math Playground – Finding the Area and Perimeter of Rectangles– This game features cartoon characters named Amy and Ben who discuss how to build a fence in the backyard
10. Baseball Geometry: CHALLENGING LEVEL: Various rectangles are displayed and students must choose the correct area. They are given 3 ball to hit for each correct answer. | 556 | 2,161 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.953125 | 4 | CC-MAIN-2017-30 | longest | en | 0.721478 |
https://www.enotes.com/homework-help/average-movie-price-us-general-lower-than-other-436346 | 1,480,871,308,000,000,000 | text/html | crawl-data/CC-MAIN-2016-50/segments/1480698541324.73/warc/CC-MAIN-20161202170901-00354-ip-10-31-129-80.ec2.internal.warc.gz | 938,430,357 | 11,900 | # Average movie price in the US are in general, lower than in other countries. It would cost \$78.52 to buy three tickets in Japan plus two tickets in Switzerland. Three tickets in Switzerland plus...
Average movie price in the US are in general, lower than in other countries. It would cost \$78.52 to buy three tickets in Japan plus two tickets in Switzerland. Three tickets in Switzerland plus two tickets in Japan would cost \$75.13. How much does an average movie ticket cost in each of these countries Japan ___ and Switxerland______?
Asked on by monique06
justaguide | College Teacher | (Level 2) Distinguished Educator
Posted on
The price of movie tickets is lower in the US compared to Japan and Switzerland.
Let the price of movie tickets in Japan be J and that in Switzerland be S. It costs \$78.52 to buy three tickets in Japan plus two tickets in Switzerland.
This gives 3J + 2S = 78.52 ...(1)
Three tickets in Switzerland plus two tickets in Japan cost \$75.13. This gives:
3S + 2J = 75.13 ...(2)
Solve (1) and (2) for S and J.
2*(1) - 3*(2)
=> 6J + 4S - 9S - 6J = -68.35
=> -5S = -68.35
=> S = 13.67
J = 17.06
The tickets cost \$17.06 in Japan and \$13.67 in Switzerland.
We’ve answered 318,915 questions. We can answer yours, too. | 348 | 1,263 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.75 | 4 | CC-MAIN-2016-50 | longest | en | 0.947722 |
http://www.convertit.com/Go/BusinessConductor/Measurement/Converter.ASP?From=survey+foot&To=height | 1,600,659,702,000,000,000 | text/html | crawl-data/CC-MAIN-2020-40/segments/1600400198887.3/warc/CC-MAIN-20200921014923-20200921044923-00570.warc.gz | 173,422,352 | 3,693 | New Online Book! Handbook of Mathematical Functions (AMS55)
Conversion & Calculation Home >> Measurement Conversion
Measurement Converter
Convert From: (required) Click here to Convert To: (optional) Examples: 5 kilometers, 12 feet/sec^2, 1/5 gallon, 9.5 Joules, or 0 dF. Help, Frequently Asked Questions, Use Currencies in Conversions, Measurements & Currencies Recognized Examples: miles, meters/s^2, liters, kilowatt*hours, or dC.
Conversion Result: ```survey foot = 0.304800609601219 length (length) ``` Related Measurements: Try converting from "survey foot" to actus (Roman actus), earth to moon (mean distance earth to moon), en (typography en), fathom, foot, football field, Greek cubit, Greek palm, Greek span, hand, ken (Japanese ken), line, link (surveyors link), micron, mile, nail (cloth nail), pace, span (cloth span), UK mile (British mile), verst (Russian verst), or any combination of units which equate to "length" and represent depth, fl head, height, length, wavelength, or width. Sample Conversions: survey foot = .00521282 arpentlin, .00833335 bolt (of cloth), .00138889 cable length, 1,200 caliber (gun barrel caliber), .01515155 chain (surveyors chain), 1,734.48 en (typography en), .01000002 engineers chain, .166667 fathom, 304,800,609,601,219 fermi, .00333334 football field, .16465456 Greek fathom, 3.95 Greek palm, .14388518 ken (Japanese ken), .00006313 league, 12,000.02 mil, .00005486 nautical league, .68571566 Roman cubit, .14492783 sazhen (Russian sazhen), .00277778 skein, .00002315 spindle.
Feedback, suggestions, or additional measurement definitions?
Please read our Help Page and FAQ Page then post a message or send e-mail. Thanks!
©2000 ConvertIt.com, Inc. All rights reserved. Terms of Use. | 474 | 1,740 | {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.046875 | 3 | CC-MAIN-2020-40 | latest | en | 0.668655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.