text:
# Python Basics

| September 16th, 2015

## The Python Interface

In the Python script on the right, you can type Python code to solve the exercises. If you hit Submit Answer, your python script (script.py) is executed and the output is shown in the IPython Shell. DataCamp checks whether your submission is correct and gives you feedback.

You can hit Submit Answer as often as you want. If you're stuck, you can click Get Hint, and ultimately Get Solution.

You can also use the IPython Shell interactively by simply typing commands and hitting Enter. When you work in the shell directly, your code will not be checked for correctness so it is a great way to experiment.

### Instructions

• Experiment in the IPython Shell; type 5 / 8, for example.
• Add another line of code to the Python script: print(7 + 10).
• Hit Submit Answer to execute the Python script and receive feedback.
# pec comes here print(5 / 8) print(5 / 8) print(7 + 10)  msg = "Don't remove the first statement. It is an example which is coded for you!" test_operator(1, incorrect_op_msg = msg, incorrect_result_msg = msg, not_found_msg = msg) test_function("print", 1, not_called_msg = msg, incorrect_msg = msg) test_operator(2, not_found_msg = "You should add a second operation, as instructed.", incorrect_op_msg = "Your second operation is wrong, be sure to add 7 to 10.", incorrect_result_msg = "The operation you added should add up to 17.") test_function("print", 2, not_called_msg = "Remember that you should call [print()](https://docs.python.org/3/library/functions.html#print) to print out the result of your calculation.", incorrect_msg = "You should type print(7 + 10) to print out the result of your calculation.") success_msg("Great!")
• Simply add print(7 + 10) in the script on the right and hit 'Submit Answer'.

To add comments to your Python script, you can use the # tag. These comments are not run as Python code, so they will not influence your result. As an example, take the comment on the right, # Just testing division: it is completely ignored during execution.

### Instructions

• Above the print(7 + 10), add the comment # Addition works too.
# pec comes here # Just testing division print(5 / 8) print(7 + 10) # Just testing division print(5 / 8) # Addition works too print(7 + 10)  test_student_typed("#\s*(\w+) works (\w+)[\s.!?]*print$$7", not_typed_msg = "Make sure to add the instructed comment right before print(7+10).") success_msg("Great!")  • For this exercise you only have to add one line of comments. It won't run as Python code. Add # Addition works too right above print(7 + 10). ## Python as a calculator Python is perfectly suited to do basic calculations. Apart from addition, subtraction, multiplication and division, there is also support for more advanced operations such as: • Exponentiation: **. This operator raises the number to its left to the power of the number to its right: for example 4**2 will give 16. • Modulo: %. It returns the remainder of the division of the number to the left by the number on its right, for example 18 % 7 equals 4. The code in the script on the right gives some examples. ### Instructions Suppose you have 100, which you can invest with a 10% return each year. After one year, it's \(100 \times 1.1 = 110$$ dollars, and after two years it's $$100 \times 1.1 \times 1.1 = 121$$. Add code on the right to calculate how much money you end up with after 7 years.

# pec comes here # Addition and subtraction print(5 + 5) print(5 - 5) # Multiplication and division print(3 * 5) print(10 / 2) # Exponentiation print(4 ** 2) # Modulo print(18 % 7) # How much is your $100 worth after 7 years?  # Addition and subtraction print(5 + 5) print(5 - 5) # Multiplication and division print(3 * 5) print(10 / 2) # Exponentiation print(4 ** 2) # Modulo print(18 % 7) # How much is your$100 worth after 7 years? print(100 * 1.1 ** 7)  msg = "You don't have to change the predefined code. Just add one line at the bottom!" for i in range(1,7): test_operator(i, not_found_msg = msg, incorrect_op_msg = msg, incorrect_result_msg = msg) test_function("print", index = i, not_called_msg = msg, incorrect_msg = msg) test_operator(7, not_found_msg = "Add an operation to calculate what's instructed.", incorrect_op_msg = "You should use at least one * and one ** operator to calculate what's instructed.", incorrect_result_msg = "You should calculate the total interest on 100 dollar after 7 years given a 10% rate.") test_function("print", index = 7, not_called_msg = "Don't forget to print out your result with [print()](https://docs.python.org/3/library/functions.html#print).", incorrect_msg = "Print out your result using print(100 * 1.1 ** 7).") success_msg("Time for another video!")
• After two years you have $$100 \times 1.1 \times 1.1 = 100 \times 1.1^2$$. How much do you have after 7 years than? Use * and **.

## Variable Assignment

In Python, a variable allows you to refer to a value with a name. To create a variable use =, like this example:

x = 5

You can now use the name of this variable, x, instead of the actual value, 5.

### Instructions

• Create a variable savings with the value 100.
• Check out this variable by typing print(savings) in the script.
# pec # Create a variable savings # Print out savings  # Create a variable savings savings = 100 # Print out savings print(savings)  test_object("savings", incorrect_msg = "Assign 100 to the variable savings.") test_function("print", incorrect_msg = "Print out savings, the variable you created, using print(savings).") success_msg("Great! Let's try to do some calculations with this variable now!")
• Type savings = 100 to create the variable savings.
• After creating the variable savings, you can type print(savings).

## Calculations with variables

Remember how you calculated the money you ended up with after 7 years of investing $100? You did something like this: 100 * 1.10 ** 7  Instead of calculating with the actual values, you can use variables instead. The savings variable you've created in the previous exercise represents the$100 you started with. It's up to you to create a new variable to represent 1.10 and then redo the calculations!

### Instructions

• Create a variable factor, equal to 1.10.
• Use savings and factor to calculate the amount of money you end up with after 7 years. Store the result in a new variable, result.
• Print out the value of result.
# pec # Create a variable savings savings = 100 # Create a variable factor # Calculate result # Print out result # Create a variable savings savings = 100 # Create a variable factor factor = 1.1 # Calculate result result = savings * factor ** 7 # Print out result print(result)  test_object("savings", undefined_msg = "The variable savings was defined for you, don't remove it!", incorrect_msg = "The variable savings should be 100, like it was defined for you.") test_object("factor", incorrect_msg = "The value of factor should be 1.1.") test_object("result", do_eval = False) test_operator(3, not_found_msg = "Have you used the correct calculations to calculate result?", incorrect_op_msg = "Use * and ** to calculate result.", incorrect_result_msg = "Have you used to correct variables to calculate result?") test_object("result", incorrect_msg = "Assign the correct value to result.") test_function("print", incorrect_msg = "You should print out the result using print(result).") success_msg("Great!")
• To create the variable factor, use factor = 1.10.
• In the example code block of the assignment, replace 100 with savings and 1.10 with factor: savings * factor ** 7.
• Use the print() function to print the value of a variable.

## Other variable types

In the previous exercise, you worked with two Python data types:

• int, or integer: a number without a fractional part. savings, with the value 100, is an example of an integer.
• float, or floating point: a number that has both an integer and fractional part, separated by a point. factor, with the value 1.10, is an example of a float.

Next to numerical data types, there are two other very common data types:

• str, or string: a type to represent text. You can use single or double quotes to build a string.
• bool, or boolean: a type to represent logical values. Can only be True or False.

### Instructions

• Create a new string, desc, with the value "compound interest".
• Create a new boolean, profitable, with the value True.
# pec # Create a variable desc # Create a variable profitable  # Create a variable desc desc = "compound interest" # Create a variable profitable profitable = True  test_object("desc", incorrect_msg = "Assign the value \"compound interest\" to the variable desc.") test_object("profitable", incorrect_msg = "Assign the value True to the variable profitable.") success_msg("Nice!")
• To create a variable in Python, use =. Make sure to wrap your string in single or double quotes.
• Only two boolean values exist in Python: True and False. TRUE, true, FALSE, false and other versions will not be accepted.

## Operations with other types

Filip mentioned that different types behave differently in Python.

When you sum two strings, for example, you'll get different behavior than when you sum two integers or two booleans.

In the script some variables with different types have already been created. It's up to you to use them.

### Instructions

• Calculate the product of savings and factor. Store the result in year1.
• What do you think the resulting type will be? Find out by printing out the type of year1.
• Calculate the sum of desc and desc and store the result in a new variable doubledesc.
• Print out doubledesc. Did you expect this?
# no pec # Several variables to experiment with savings = 100 factor = 1.1 desc = "compound interest" # Assign product of factor and savings to year1 # Print the type of year1 # Assign sum of desc and desc to doubledesc # Print out doubledesc  # Several variables to experiment with savings = 100 factor = 1.1 desc = "compound interest" # Assign product of savings and factor to year1 year1 = savings * factor # Print the type of year1 print(type(year1)) # Assign sum of desc and desc to doubledesc doubledesc = desc + desc # Print out doubledesc print(doubledesc)  msg = "You don't have to change or remove the predefined variables." test_object("savings", undefined_msg = msg, incorrect_msg = msg) test_object("factor", undefined_msg = msg, incorrect_msg = msg) test_object("desc", undefined_msg = msg, incorrect_msg = msg) test_operator(3, not_found_msg = "Calculate year1 using the * operator.", incorrect_op_msg = "To calculate year1, you should use * once.", incorrect_result_msg = "You should use savings and factor to calculate year1. Take a look at the hint if you're stuck.") test_object("year1", incorrect_msg = "Assign the correct value you calculated to year1.") msg = "Make sure to print out the type of year1 like this: print(type(year1))." test_function("type", incorrect_msg = msg) test_function("print", 1, incorrect_msg = msg) msg = "You can add up a string to another string, just type desc + desc." test_operator(4, not_found_msg = msg, incorrect_op_msg = msg, incorrect_result_msg = msg) test_object("doubledesc", incorrect_msg = "Assign the resulting string to doubledesc.") test_function("print", 2, incorrect_msg = "Be sure to print out doubledesc.") success_msg("Nice. Notice how desc + desc causes \"compound interest\" and \"compound interest\" to be pasted together.")
• Assign factor * savings to a new variable, year1.
• To print the type of a variable x, use print(type(x)).
• Assign desc + desc to a new variable, doubledesc.
• To print a variable x, write print(x) in the script.

## Type conversion

Using the + operator to paste together two strings can be very useful in building custom messages.

Suppose for example that you've calculated the return of your investment, and want to summarize the results in a string. Assuming the floats savings and result are defined, you can try something like this:

print("I started with $" + savings + " and now have$" + result + ". Awesome!")

This will not work, though, as you cannot simply sum strings and floats.

To fix the error, you'll need to explicitly convert the types of your variables. More specifically, you'll need str(), to convert a value into a string. str(savings), for example, will convert the float savings to a string.

Similar functions such as int(), float() and bool() will help you convert Python values into any type.

### Instructions

• Hit Submit Answer to run the code on the right. Try to understand the error message.
• Fix the code on the right such that the printout runs without errors; use the function str() to convert the variables to strings.
• Convert the variable pi_string to a float and store this float as a new variable, pi_float.
# pec # Definition of savings and result savings = 100 result = 100 * 1.10 ** 7 # Fix the printout print("I started with $" + savings + " and now have$" + result + ". Awesome!") # Definition of pi_string pi_string = "3.1415926" # Convert pi_string into float: pi_float  # Definition of savings and result savings = 100 result = 100 * 1.10 ** 7 # Fix the printout print("I started with $" + str(savings) + " and now have$" + str(result) + ". Awesome!") # Definition of pi_string pi_string = "3.1415926" # Convert pi_string into float: pi_float pi_float = float(pi_string)  msg = "You don't have to change or remove the predefined variables." test_object("savings", undefined_msg = msg, incorrect_msg = msg) test_operator(1, not_found_msg = msg, incorrect_op_msg = msg, incorrect_result_msg = msg) test_object("result", undefined_msg = msg, incorrect_msg = msg) test_operator(2, not_found_msg = msg, incorrect_op_msg = msg, incorrect_result_msg = msg) test_function("str", 1, incorrect_msg = "You should use str(savings) first.") test_function("str", 2, incorrect_msg = "You should use str(result) the second time.") msg = "To form the long string, you can use the + operator. The only thing you have to edit in the printout is that you have to convert savings and result to strings." test_operator(3, not_found_msg = msg, incorrect_op_msg = msg, incorrect_result_msg = msg) test_function("print", incorrect_msg = "The string you're trying to print is not quite right. Have another look at the description of this problem.") msg = "You don't have to change or remove the predefined variables." test_object("pi_string", undefined_msg = msg, incorrect_msg = msg) test_object("pi_float", do_eval = False) test_function("float", incorrect_msg = "Pass pi_string to [float()](https://docs.python.org/3/library/functions.html#float) in order to convert it to a float.") test_object("pi_float", incorrect_msg = "Assign the correct value to pi_float.") success_msg("Great! You have a profit of around \$95; that's pretty awesome indeed!")


text:
# Writing a Unix Shell - Part III

Previously, in Part II we discussed about running system commands and implementing our own built-in commands. In Part III, we explore signal handling.

## What are signals?

When driving, one looks out for traffic signals, red or green and takes a decision based on it: to stop or to keep driving. But the traffic signals only come up after some intervals at crossroads and is not present continuously along the road.

We can somewhat apply this analogy to signals in the context of computers as well. A signal is a software interrupt that is sent out from an external event to a process. It may be sent to the process by the kernel, by another process or by itself. A very common example is SIGINT, which is the signal that is sent out when you hit Ctrl-C to exit a program. Before going any further, let us take a look at the following diagram:

The process executes three instructions and terminatess. However, after the second instruction, it receives a signal. At this point the regular execution of the program is interrupted and is passed on to the signal handler. The signal handler is a pre-defined function which is invoked when the signal is received. It returns the process to its normal execution flow, where it goes on to execute the third instruction and exits. However, depending on the code in the signal handler itself, instruction 3 might not be executed at all. For eg: If the signal being sent is SIGINT (Ctrl-C), the program exits. Also, it is not guaranteed that a signal interrupt will only occur when a program is between instructions. It may occur when an instruction is executing and in such a case the instruction will get interrupted.

One important thing to note is that, while the main function runs in its own thread the signal handler also runs in its own thread. Both the threads belong to the same process though.

Edit: I misunderstood this line from The Linux Programming Interface, section 21.1.2:

Because a signal handler may asynchronously interrupt the execution of a program at any point in time, the main program and the signal handler in effect form two independent (althought not concurrent) threads of execution within the same process.

I asked around on IRC[1] about this and it turns out that, “in effect” is the keyword here. It does not really create a thread for the signal handler. However, when a signal is delivered, the signal handler asynchronously interrupts a thread (in our case the main thread since we have a single threaded application). Once interrupted, the signal handler executes its own code, and the thread may resume execution unless the signal handler exits the program. The analogy to multiple threads helps to understand the flow of execution.

## Signal handling

Now that we understand signals, let us run the code for the shell we had from Part II. If you run the executable and run the command sleep 10 in the shell and hit Ctrl-C before the command finishes, you will notice that along with the command, our shell has quit as well.

$gcc -lreadline shell_with_builtin.c && ./a.out unixsh> sleep 10 ^C$

You will notice the same behaviour if you hit Ctrl-Z as well, which generates the SIGTSTP signal. This stops the current running process. Currently, the shell is reacting to the default signal handlers set up by the operating system. The good news is that we can customize this behaviour. We can use the function signal() defined in signal.h:

The first argument to the function is the signal number. Each signal has a predefined integer value assigned to it. This number is 2 for SIGINT and 20 for SIGTSTP.

The second argument is a pointer to a signal handler. The signal handler is a function that must accept an int as the only parameter and return void as described by the typedef sighandler_t.

Let us write a minimal program to handle SIGINT:

sigint.c

We run an infinite while loop here on typing Ctrl-C you will notice the text Caught SIGINT printed to the terminal, but the program will continue to run after that. You can stop it with Ctrl-Z. Here’s the output from a sample run:

$gcc sigint.c && ./a.out ^CCaught SIGINT ^CCaught SIGINT ^Z [2]+ Stopped ./a.out  C provides two very useful macros that can be passed to the signal function: • SIG_IGN: Ignores the signal. Usage: signal(SIGINT, SIG_IGN). • SIG_DFL: Sets the default behaviour for the signal. This is useful when you want to reset the behaviour for a signal after having made some modifications. Usage: signal(SIGINT, SIG_DFL). However, it is not possible to ignore, block or setup a custom handler for SIGKILL and SIGSTOP. Blocking a signal means that the signal will not be delivered to the process at all. We will now use signal handling in our shell and modify our code by adding a call to signal() just before the while loop: The modified file is available here. If you compile and execute the binary and hit Ctrl-C, the shell does not quit anymore. But if you run sleep 10 in the shell and hit Ctrl-C, the command does not quit as well. The reason behind this is that when a fork is called, apart from duplicating the parent process, it copies the current signal configurations (also known as the signal dispositions) as well. Since we are ignoring SIGINT in the parent, the child also inherits the same property for SIGINT from its parent and conveninently ignores the keyboard interrupt (Ctrl-C). To prevent this, we will restore the default behaviour of SIGINT in the child process after fork. Note that this must be done before the call to execvp since it will replace the current program with the program passed in the command. The modified file is available here. ## Signal masks Each process has an attribute called the process signal mask which is maintained by the kernel. Any signal that is added to the signal mask gets blocked from being delivered in the future, unless the signal is removed from it. This is useful when we want to block a signal based on the application logic. Now, let’s look at the following workflow for an example: 1. A signal is delivered. The signal handler gets invoked and is in the middle of executing some instructions. 2. The same signal is delivered again and the signal handler is invoked once again. The previous instance of the signal handler will get interrupted by a new instance of the signal handler. This is not very desirable. To prevent the signal handler from interrupting itself, the original signal that invoked the signal handler gets added to the signal mask by default. This means that the same signal will not interrupt the current instance of the signal handler. And once the signal handler returns, the signal is removed from the mask. ## Non local jumps Currently, the shell does not do anything when it encounters a Ctrl-C, while waiting for a command input. We would like to change this behaviour to restart the while loop from the top and print a newline. Effectively, Ctrl-C would mean a soft reset of the command line. This brings us to the functions setjmp and longjmp, which are used to perform a non local jump. This is equivalent of using a goto statement to jump across scopes, except that the scope of a goto is restricted to within a function. These functions are defined in setjmp.h and their signatures look like this: The setjmp() function sets a jump point and takes a buffer of type jmp_buf which is used to store details like the stack pointer and the instruction pointer. It returns 0 once the jump point has been set. The longjmp() function uses the buffer which contains values saved by setjmp() to determine the jump point in the program. Additionally it takes an integer value, which is returned when the code returns to the jump point. Here’s an example: setjmp_longjmp.c A few important things to note about the code above: 1. The call to signal() takes a pointer to the sigint_handler() function instead of SIG_IGN (line 13). 2. When the code reaches line 15 for the first time, setjmp() is invoked and returns 0. 3. After the signal handler has been registered, if we type Ctrl-C, the longjmp() function call is invoked where we pass 42 to it. The code jumps to line 15 and this time setjmp() returns the value that was passed in longjmp() on line 9, i.e. 42. Thus the check evaluates to true, which signifies that we reached this code from a non local jump. This is also referred to as a fake return by setjmp(). If you compile and execute the binary, the output would be similar to: $ gcc -lreadline -g setjmp_longjmp.c && ./a.out
next iteration...
^CRestart.
next iteration...
^Cnext iteration...
next iteration...
^Z
[6]+  Stopped                 ./a.out

But, Restart will be printed to the screen only the first time you hit Ctrl-C. The reason behind this is that the first time the signal handler is invoked for SIGINT, it blocks the signal and the call to longjmp() does not unblock the signal since the signal handler never really returns. As a result, SIGINT does not get delivered after the first time.

To fix this problem, we have sigsetjmp() and siglongjmp(). The function signatures are:

They are similar to setjmp() and longjmp(), but they accept a buffer of type sigjmp_buf instead of jmp_buf. Also, the sigsetjmp() function accepts a flag savesigs. If value of this flag is non zero, then sigsetjmp() saves the current process signal mask and restores it when siglongjmp() is invoked. This means, that the signal which initially gets blocked on invoking the signal handler, gets unblocked as soon as siglongjmp() is invoked.

And here’s an example using these functions:

sigsetjmp_siglongjmp.c

Note that the function call to sigsetjmp() on line 15 accepts an extra parameter for the savesigs flag. Also, env is of type sigjmp_buf. And if you compile and execute it you will notice that Ctrl-C is accepted more than once, until you stop the program:

\$ gcc -lreadline -g sigsetjmp_siglongjmp.c && ./a.out
next iteration...
^CRestart.
next iteration...
^CRestart.
next iteration...
^Z
[7]+  Stopped                 ./a.out

There’s one last catch about this arrangement though. We setup the signal handler before setting a jump point. But there is no guarantee that a signal will only be delivered after the jump point has been set. And if this scenario takes place, our program will crash. To avoid this we add a global flag that is false by default. Once the jump point has been set, we set the flag to true and add a check on this flag in our signal handler. If the flag is false, we skip the call to longjmp() and return from the handler instead. Here’s our updated signal handler and main function:

sigsetjmp_siglongjmp_with_check.c

The flag jump_active is of type volatile sig_atomic_t. This is essential, since this flag will be accessed asynchronously by multiple threads of the process, i.e. the main thread and the signal handler thread. The type guarantees atomic access to the variable across multiple threads.

This brings us back to the first example, sigint.c where we used printf in the signal handler. printf is an async unsafe function. Which means, that if the signal handler is invoked while another printf is executing in a different part of the program, the output may be erratic. We use printf only to explain the concept here, and it should not be used in real life applications.

## A better way for signal handling: sigaction

So far we have used the signal() function for setting signal handlers. However, its implementation differs from system to system and is generally not recommended to be used directly in application code since its usage makes portability hard. The alternative is to use the sigaction() function call.

This is also defined in signal.h, but before we look at its signature, lets look at the definition of the struct sigaction (yes, sadly they are both named the same):

The struct requires:

• sa_handler: A pointer to the signal handler.
• sa_sigaction: A pointer to a signal handler that can access more information regarding the signal. Either one of sa_handler or sa_sigaction should be used.
• sa_mask: An optional set of signals which are blocked while the signal handler is executing.
• sa_flags: A bitwise OR of config flags.
• sa_restorer: This is for internal use and should not be set.

Now let us look at the signature of the sigaction() function:

It accepts the signal number and two sigaction struct objects. The first contains new configuration to be set, while the second is used to save the current configuration before overwriting it with the new one.

In our previous code, we replace signal(SIGINT, signal_handler by:

The sigemptyset() function initializes the sa_mask attribute of the struct with an empty set. We set the SA_RESTART flag on the struct, which implies that if the signal handler is invoked while the program is in the middle of a system call, the system call will be restarted after the signal handler has finished its execution. And finally, we call the sigaction() function with the signal and the sigaction struct. We do not care about the previous configuration for the signal and pass NULL instead of another sigaction struct object. The example is available here.

## One last trivia

During this exercise contrary to my belief I realized that on typing Ctrl-D no signal is generated like it does when we type Ctrl-C. Rather it sends the EOF character. Since we’ve changed Ctrl-C to not quit the shell, we implement Ctrl-D to do that instead for us, which is similar to the behaviour of bash. The following snippet helps us do this:

The code for the shell with the concepts explained above is available here, but it is recommended that readers try to implement it themselves.

That brings us to the end of part III. All the code examples shown in this blog post are available here. In the next blog post we will see how to run background commands and perform job control. Stay tuned.

## Acknowledgements

Once again thanks to Dominic Spadacene for pairing with me on this and to Saul Pwanson for being patient with my endless questions.

[1] - Also, thanks to valdis and derRichard on #kernelnewbies (irc.oftc.net) for helping me understand the asynchronous nature of a signal handler.

format: plain


text:
# Seconds to minutes

## Convert from seconds to minutes step by step

This free conversion calculator will convert seconds to minutes, i.e. s to m. Correct conversion between different measurement scales.

The formula is $T_{\text{m}} = 0.016666666666667 T_{\text{s}}$, where $T_{\text{s}} = 15$.

Therefore, $T_{\text{m}} = 0.25$.

Answer: $15 \text{s} = 0.25 \text{m}$.


text:
Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

What is the molar volume of gases at STP?

The molar volume of an ideal gas at STP is 22.71 L.

NOTE: Most text books and websites list the molar volume of a gas as 22.4L. That value is based on the STP values which were used before 1982 (273.15K and 101.3 kPa). The correct value of 22.71L is based on the IUPAC definition of STP being 273.15K and 100 kPa which has been used since the change in 1982. The web sites and books that list 22.4 are just not posting the most current (and correct) information. Try substituting 101.3 kPa into Ernest's work and you'll see that this is true.

To determine the volume of an ideal gas, we can use the .

PV = nRT

V = (nRT)/P

n = "1 mol" R = "8.314 kPa·L·K"^(-1)"mol"^(-1) "STP" = "100 kPa" and "273.15 K"

V = (nRT)/P = (1 cancel("mol") × 8.314 cancel("kPa")·"L"·cancel("K⁻¹mol⁻¹") × 273.15 cancel("K"))/(100 cancel("kPa")) = "22.71 L"

The molar volume of an ideal gas at STP is 22.71 L.

In practice, no gas is ideal.

Every real gas has molecules with a definite size and with attractive forces between them.

Even helium, which you would expect to be the most ideal, has a molar volume of 22.73 L.

The molar volumes of other common gases at STP are H₂ =22.73 L; O₂ = 22.68 L; NH₃ = 22.56 L; H₂O = 22.50 L.

Simple answer, with some historical background are on this site: http://www.chemteam.info/GasLaw/MolarVolume.html


text:
# Vilas Company is considering a capital investment of $146, 940 in additional productive facilitie... I. What is also the net present value Vilas Company is considering a capital investment of$146, 940 in additional productive facilities. The new machinery is expected to have a useful life of 8 years with no salvage value. Depreciation is by the straight-line method. During the life of the investment, annual net income and cash inflows are expected to be $18, 780 and$47, 400, respectively. Vilas has a 10% cost of capital rate, which is the required rate of return on the investment. Compute (1) the cash payback period and (2) the annual rate of return on the proposed capital expenditure. (Round Rate of Return and Payback to 2 decimal places, e.g. 23.70% or 6.50.) (1) Cash payback years (2) Annual rate of return %

## Related Questions in Accounting Standard Codifications

• ### Padre, Inc., buys 80 percent of the outstanding common stock of Sierra Corporation on January 1, ...

February 17, 2018

• ### Below are amounts (in millions) from three companies' annual reports. ...

(Solved) February 04, 2018

. Round your "Average accounts receivable" and "Receivables turnover ratio" answers to one decimal place.) 2 . Which company appears most efficient in collecting cash from sales? WalCo TarMart Cost Get WalCo TarMart Cost Get WalCo Tar

1 Recievable Turnover Ratio Average Accounts Recievables Net Sales / Average Accounts Recievables Recievable Turnover Ratio Opening AR Closing AR (Opening AR+Closing AR)/2 Walco 320427 /...


text:
# Question d2b4f

Oct 7, 2017

The answer is indeed (B) $\text{203 g}$.

#### Explanation:

The first thing that you need to do here is to figure out how much heat is being given off when $\text{30.1 g}$ of steam, presumably at ${100}^{\circ} \text{C}$, are being converted to $\text{30.1 g}$ of liquid water at ${100}^{\circ} \text{C}$.

To do that, you can use the standard molar enthalpy of vaporization of water, $\Delta {H}_{\text{vap}}^{\circ}$, which tells you how much heat is being given off when $1$ mole of water is converted from steam at ${100}^{\circ} \text{C}$ to liquid water at ${100}^{\circ} \text{C}$, at standard pressure.

So, use the molar mass of water to convert the mass of steam to moles

30.1 color(red)(cancel(color(black)("g"))) * ("1 mole H"_2"O")/(18.015color(red)(cancel(color(black)("g")))) = "1.671 moles H"_2"O"

You can thus say that condensing $\text{30.1 g}$ of steam at ${100}^{\circ} \text{C}$ to lqiuid water at ${100}^{\circ} \text{C}$ will give off

1.671 color(red)(cancel(color(black)("moles H"_2"O"))) * "40.7 kJ"/(1color(red)(cancel(color(black)("mole H"_2"O")))) = "68.01 kJ"

Now, the specific heat of water tells you how much heat is needed to increase the temperature of $\text{1 g}$ of water by ${1}^{\circ} \text{C}$.

More specifically, you know that in order to increase the temperature of $\text{1 g}$ of water by ${1}^{\circ} \text{C}$, you need to provide the sample with $\text{4.184 J}$ of heat.

In your case, you need to change the temperature of the sample by

${100.0}^{\circ} \text{C" - 20.0^@"C" = 80.0^@"C}$

so start by calculating how much heat would be needed to do that for a given mass of water.

80.0 color(red)(cancel(color(black)(""^@"C"))) * "4.184 J"/("1 g" * 1color(red)(cancel(color(black)(""^@"C")))) = "334.72 J g"^(-1)#

This tells you that in order to increase the temperature of $\text{1 g}$ of water by ${80.0}^{\circ} \text{C}$, you need to supply the sample with $\text{334.72 J}$ of heat.

This means that the heat given off by the steam $\to$ liquid phase change will be enough to heat--remember that $\text{1 kJ} = {10}^{3}$ $\text{J}$

$68.01 \cdot {10}^{3} \textcolor{red}{\cancel{\textcolor{b l a c k}{\text{J"))) * overbrace("1 g"/(334.72 color(red)(cancel(color(black)("J")))))^(color(blue)("for an increase of 80.0"^@"C")) = color(darkgreen)(ul(color(black)("203 g}}}}$

The answer is rounded to three sig figs.


text:
# Finding relations using Maple

Suppose that one has 3 (complicated) functions $f(x)$, $g(x)$, and $h(x)$. I would like to use Maple to find any relations that may exist between these functions. For instance, if it so happens that $f(x)=5g(x)$, I would like to uncover that. Is there a Maple command which takes a set of `things' and compares them, with the goal of uncovering any relations that may exist.

-
Try to ask at mapleprimes.com as well. – Babak S. Dec 5 '12 at 18:57

## 1 Answer

It depends on what kind of relations you are expecting. If you think there is a linear dependence (with constant coefficients), take the vectors $\langle f(x), g(x), h(x) \rangle$ for (more than three) different values of $x$ and see if they are linearly dependent.

If you think there is a polynomial $P(f(x),g(x),h(x))=0$ of degree at most $n$, do the same for products...

-
Where? I don't see any expression. – Robert Israel Dec 5 '12 at 23:06


text:
# Is current still split in a parallel circuit with two branches when one of the branches is broken? [closed]

I'm given the following circuit:

The bulbs are identical and A1, A2, and A3 are ammeters. A1 reads 0.6A

I'm told to find the readings of all the ammetres when the bulb labelled 'X' is removed such that a break occurs in that branch.

The answer I'm given is that A1 = 0.3A and A2 = 0.3A, while A3 = 0.0A. But why?

Is it not that since there is a break on the right most branch, that the circuit becomes a series circuit and so the current is no longer split? So A1 = 0.6A and a2 = 0.6A, while A3 = 0.0A?

## closed as off-topic by John Rennie, stafusa, Jon Custer, Yashas, Daniel GriscomJan 1 '18 at 20:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Homework-like questions should ask about a specific physics concept and show some effort to work through the problem. We want our questions to be useful to the broader community, and to future users. See our meta site for more guidance on how to edit your question to make it better" – John Rennie, stafusa, Jon Custer, Yashas, Daniel Griscom
If this question can be reworded to fit the rules in the help center, please edit the question.

In the first instance, when bulb $X$ isn't removed, the voltage in the circuit is $V=0.6R_2$ where $$R_2=\frac{1}{\frac{1}{R_1}+\frac{1}{R_1}}=\frac{R_1}{2}$$ and hence $V=\frac{0.6R_1}{2}=0.3R_1$. When the other bulb is removed, you have $0.3R_1=IR_1$ and you can see how the result follows.
The voltage is constant. The initial resistance is the effective resistance of 2 bulbs, each of resistance R, which is $R/2$. Hence 0.6 x $R/2$ = V. This means 0.3 x $R$ = V. Our final resistance is R. So this means our final current is 0.3. Hence A1 = A2 = 0.3, and A3 = 0 since it is an open circuit and no current flows through it. Hope this helps.


text:
## Ka and Kb

Acidity $K_{a}$
Basicity $K_{b}$
The Conjugate Seesaw $K_{a}\times K_{b}=K_{w}$

Malia Shitabata 1F
Posts: 109
Joined: Sat Aug 17, 2019 12:17 am

### Ka and Kb

For polyprotic acids, Ka1 is always greater than Ka2 and the first step is always the stronger acid. Does the same go for Kb? Would Kb1 be greater than Kb2 and the first step indicate the stronger base?

Ryan 1K
Posts: 75
Joined: Fri Aug 09, 2019 12:15 am

### Re: Ka and Kb

Yes I would assume so since polyprotic bases and Kb values act similar to acids other than accepting protons. Although it is in reverse, polyprotic bases would accept protons less and less readily the more protons they gain.

Kennedi2J
Posts: 81
Joined: Wed Sep 18, 2019 12:20 am

### Re: Ka and Kb

Is there any examples of this in the textbook? It would make more sense if I saw problem related to this topic

Ryan 1K
Posts: 75
Joined: Fri Aug 09, 2019 12:15 am

### Re: Ka and Kb

No, I don't think the book goes into detail about bases that accept multiple protons, but it should be the same as polyprotic acids, only in reverse order. The same trends apply.


text:
# Could a radio telescope orbit Earth-Moon L2 so that it is in the Moon's radio shadow?

Chang'e 4, a Lunar orbiter and lander on the far side of the Moon, will put a relay satellite in a halo orbit around EML2 that also will do some low frequency radio astronomy. Since the Chang'e 4 satellite will also be a relay satellite, it obviously will have Earth in lone of sight at least part time. More generally, could any potential telescope around EML2 use a halo orbit that takes advantage of the Moon shadowing radio disturbances from Earth, as if it were on the surface on the far side of the Moon?

It's a reasonably easy calculation how far from L2 you can go and still be in radio shadow. Roughly, if you move x km from L2 (in a non-radial direction) you can see Earth's limb if $7*(1700-x) > 6000$ which gives something like $x < 800$. This is unfortunately not far enough to reach any of the stable Halo orbits (which are probably not that stable for the Moon anyway, due to perturbation from the Sun), so you would need to use a small amount of fuel actively station-keeping. On the other hand, a radio astronomy satellite probably has a rather accurate idea of its position, as a pre-requisite for doing its job, so it could stay very precisely on L2, using very little fuel.


text:
# Talk:Least common multiple/Student Level

Main Article
Talk
Related Articles  [?]
Bibliography  [?]
Citable Version  [?]
Student Level [?]

Excellent article in progress! Anyone have any comments to make? I wouldn't be surprised if this goes up for approval quickly. - Greg Martin 23:54, 13 May 2007 (CDT)

Thank you.
I think more should be added before approval. Maybe some stuff about polynomials, some more applications, some things about somewhat abstract number theory... Michael Hardy 13:43, 14 May 2007 (CDT)

I'd be happy to write up a section on finding the least common multiple of polynomials. I'm actually teaching this section right now so it's fresh in my mind. I'll get on it today David Martin 13:17, 15 May 2007 (CDT)

## Cancelling before multiplying

Where it says "Note: Always cancel before multiplying." I would suggest something gentler such as "Note: The arithmetic is simpler if you cancel before multiplying," since if you multiply first and then cancel you will still get the right answer. --Catherine Woodgold 20:35, 14 May 2007 (CDT)

I think the comment should be made stronger. Citing only simplicity of arithmetic understates the point. It is frustrating to keep finding students who are alleged to have passed high-school algebra neglecting this point and acting just as if they've never heard of it. (OK, I'm going to restrain myself from getting carried away about engineering students who can't do arithemetic correctly with or without a calculator.) I'd attend to it instantly but for one fact: The most cogent way of illustrating this point is probably by citing some examples of horrible things that can happen when it is neglected. But it may be cumbersome to think of a simple example that does not get far too far from the present topic. Possibly this should be expanded on in some article on algebra when a link and a stern reminder here. Michael Hardy 16:42, 19 May 2007 (CDT)
OK, maybe the part about doing arithmetic should become a separate article. Students seem FAR too ready to believe uncritically everything they get from a correctly functioning calculator. Often they use calculators as anesthetics rather than for calculation... Michael Hardy 16:45, 19 May 2007 (CDT)
I look forward to eventually finding out what the other reason(s) is/are. --Catherine Woodgold 17:45, 19 May 2007 (CDT)
This is a little divergent but it got me thinking about giving reasons and using real examples in math. Hungary, in the 19th century if I remember correctly, obtained a certain amount of autonomy, in education and in other areas, from the Hapsburg Empire and changed their education significantly. One aspect of this change effected the teaching of math, particularly in the gymnasium in Budapest. They employed real examples and with additional encouragment began to develop world class mathematicians. Placing math within reach and showing how it is needed and why learning math is important has been succesful to an extraordinary degree. Making the article, making the link here ot the subject at hand, pertinent to students who may not understand its signicance, would be a constructive step. --Thomas Simmons 21:06, 20 May 2007 (CDT)

## A suggestion

As a high school math teacher, I have to teach this concept all the time. My first suggestion would be to use smaller numbers in the example for the prime factorization method. It's hard to comprehend with such large numbers and so many prime factors. Maybe use 4 and 18. Then, offer a second example using larger numbers. This makes it much more accessible to the common reader.

Also, format the prime factors like so:

______

Then you just have to bring down one of each factor per column.

If you were to add a third number to the mix, it'd look like:

______________
______

Is this too teacherish for the an article entry? David Martin 13:15, 15 May 2007 (CDT)

I'm going to think about this and some suggestions by Larry Sanger, and probably add some stuff on polynomials. Michael Hardy 22:52, 15 May 2007 (CDT)
As for the question, "Is this too teacherish?" I think that at this level we should be targeting the potential audience which will probably not be graduate students but very young students who are learning this for the first time. Giving numerous simple examples is an advantage here. In addition, this approach will make the entire CZ more accessible for a broader range of readers, in this case teachers as well as students. The ability to explain things simply and provide examples will be well and truly appreciated. --Thomas Simmons 18:37, 19 May 2007 (CDT) +11 hours (EPT)

### Supplemental sites for extended teaching

Here are additional sites to extend the article:

• Explanation and some test questions [1]
• Simple explanation and test input by the reader [2]
• Simple explanation and example [3]
• Additional subjects for pre-algebraic functions [5]
• Simple and extended definition with test input for reader [6]
• Calculates Greatest Common Divisor and Least Common Multiple [8]
• On-line math work sheet generator with answer key [9]

--Thomas Simmons 20:46, 19 May 2007 (CDT)

## Article intro

In reading the article intro, I have two points. The first is that it states that the LCM of 9 and 12 is 36 without any explantion. To the common reader, this is not intuitive. It might help to actually list the multiples to show that 36 is the first common multiple (and thus the least).

Also, the application in finding the LCD to add/suntract fractions seems misplaced. It might fit better in a section on applications of the concept. I just feel like a reader will not get the application until after reading the sections on finding it. ...said user:David Martin (talk) (Please sign your talk page posts by simply adding four tildes, ~~~~.)

I think it's OK as it is on this point. Some readers will simply accept the statement that it is the smallest multiple; others will do the rather simple arithmetic to check this for themselves. Just convincing oneself that there don't seem to be any smaller common multiples (or that there certainly aren't) can be done quickly in one's head by many people, I think. --Catherine Woodgold 17:50, 19 May 2007 (CDT)
Actually I think this simply points out the primary assumption--where they are starting. David is correct, it is not intuitive. Ask a class of year 10s in a mid range high school in New Zealand (where they claim to have a good programme)--what are the first five multiples of 5? You'll get blank looks. At which age does the reader know what a multiple is? How often do they even use the term? You may have to jog their memory. It comes back to the question of whom the reader is and what the article is attempting to do.--Thomas Simmons 23:56, 19 May 2007 (CDT)

I don't see why you say it's without explanation. The explanation is there. It says:

Since
36 = 12 × 3, and
36 = 9 × 4,
36 is indeed a multiple of both 9 and 12.

If they don't know what a multiple is, this tells them. Michael Hardy 18:31, 20 May 2007 (CDT)

Will the article consider LCMs for polynomials, fractions etc.? --Thomas Simmons 00:53, 20 May 2007 (CDT)

Certainly for polynomials. As for fractions... I've never seen anyone speak of LCMs for fractions, but in Euclidean goemetry, one speaks of the "greatest common measure" of "commensurable" line segments and the like, and that's rather like the gcd, and the lcm is certainly a related concept. Michael Hardy 16:15, 21 May 2007 (CDT)
Finding the least common multiple for the least common denominator.--Thomas Simmons 20:36, 22 May 2007 (CDT)
Which is already there. OK Slipped by the first read. Never mind.--Thomas Simmons 20:39, 22 May 2007 (CDT)
I don't know if it appears in any paper\textbook, but Mathematica extends its GCD and LCM functions to rational numbers, in a natural way. We know that if we write two (whole) numbers as a product of prime powers, the LCM is obtained by taking the maximum of the exponents, and the GCD by taking the minimum. We can do the same when the exponents are allowed to be negative. So for  and , the GCD is  and the LCM is . Meni Rosenfeld 08:21, 11 November 2007 (CST)

## "A simple theoretical question and a primitive algorithm"

Is this section really necessary? It seems to me that it uses a lot of words to provide little insight. I think it is clear to a typical reader of this article that the product of two numbers is a common multiple of them. Meni Rosenfeld 15:31, 8 November 2007 (CST)

Try it with fifty undergraduates not specializing in mathematics. Give them a pair of numbers without really obvious common factors, somewhat similar in size, for which the LCM is more than about 8 times the size of either and much smaller than their product. List the first several multiples of each and tell them how the pattern continues: 18, 36, 54, 72, 90, ... etc. Ask them whether those two lists could go on forever without having any numbers in common. Ask those who think the answer is "yes" to raise their hands; similarly with "no". THEN ask whether this section is necessary. Michael Hardy 21:34, 9 November 2007 (CST)
I find myself agreeing with Meni. In Michael's scenario, I would imagine that the problem most of the students have is that NO common multiples immediately spring to mind. Thus, some will guess that maybe there won't be any in common. I would guess that if you tell them from the outset that the product of two numbers is a common multiple of both, then it won't take them long to believe it.Barry R. Smith 16:53, 30 March 2008 (CDT)
I looked at the section again today -- I still think that it is unnecessary for the above reasons, but if it stays, I think one addition is needed. It seems that the section only implies that the first number appearing in both lists will be the lcm, but it should explicitly say this from the outset.Barry R. Smith 22:32, 3 April 2008 (CDT)

## Common Denominator Example

Given the intended audience, I think an explanation of the first step of the least common denominator example should be provided -- i.e., where did the extra factors in the numerator and denominator come from, why are you allowed to put them in, and how did adding them accomplish what we needed?

## Give more explicit reasons

There is a similar difficulty with the examples on calculating the LCM with and without the prime factorizations. Somewhere in the example with prime factorizations, the reader should be explicitly informed that you always take the largest number of times a given prime appears in any of the numbers and include that power in the LCM. Similarly, in the example without the prime factorizations, they reader should be told that the quotient formed is always the product of the two given numbers divided by the GCD. Also, some mention should be made of the fact that this procedure only works for finding the LCM of two numbers. When you have three or more numbers, the procedure is more involved (but it is still possible to do without the prime factorizations -- you would need to iterate the procedure for finding the LCD of two numbers).Barry R. Smith 22:41, 3 April 2008 (CDT)


text:
# Why is OH group activating towards electrophilic aromatic substitution?

In phenol, the OH group has -I effect due to electronegative oxygen. So, OH group should deactivate the benzene ring towards electrophilic substitution.

[P.S.: I am not talking about the o,p-directing ability of OH, which appears due to lone pair. Also please do not suggest me the question at the link Why is a hydroxyl group more activating than a methoxy group in electrophilic aromatic substitution?, because that is not what I am looking for.]

The oxygen in the $\ce{-OH}$ group in phenol has unpaired electrons that are capable of being donated to the ring. Although oxygen is electronegative and does exhibit some I- effects, the electron sharing that oxygen is capable of (shown by when drawing the resonance structures) has a stronger effect and results in $\ce{-OH}$ being a good ring activator. I've included the resonance structures below.


text:
Reference on generalization of plane graph duality between bonds and simple cycles

I've also asked this question on Mathoverflow, but it hasn't gotten an answer after several months: https://mathoverflow.net/questions/316132/reference-on-generalization-of-plane-graph-duality-between-bonds-and-simple-cycl

Let $$G$$ be a plane graph, and $$G^*$$ its dual. Among the $$k$$ partitions of the nodes of $$G$$, I'll call the connected k-partitions those such that each block of nodes of the partition induces a connected subgraph of $$G$$.

It is well known that the connected 2-partitions of the vertices $$G$$ are dual to the simple cycles of $$G^*$$. (The duality is by sending the partition to the cut edges of that partition. This is also called the bond / simple cycle duality.)

I can prove (it is not hard, unless I made a mistake) that the connected $$k$$-partitions of the vertices of $$G$$ are dual to the set of edge subgraphs $$K$$ of $$G^*$$ with

• $$H_1(K)$$ is of rank $$k - 1$$
• Each connected component $$K$$ is $$2$$ edge connected.

Again, the duality is by sending a partition to the cut edges in that partition. In the other direction, it comes by taking the connected components of $$G$$ after removing the edges crossing the subgraph $$K$$.

I use this result in the course of some other proof, and I'm looking for a reference for it (as this seems like the kind of thing that is either wrong, or well known).


text:
# Does the series $\sum_{n=1}^{\infty} \frac{\sin{6n}}{1+2^n}$ converge or diverge?

I'm having trouble identifying which test to use since the terms in the series oscillate between positive and negative values.

• Note that $$\frac{|\sin 6n|}{1+2^n}\leq\frac{1}{1+2^n}<\frac{1}{2^n}$$ and $\sum_{n=1}^\infty\frac{1}{2^n}$ converges. – DiegoMath Apr 17 at 22:39
• Thus, the series converges absolutely. Now, by comparison test... – DiegoMath Apr 17 at 22:39
• @DonAntonio Indeed, thanks! I fixed the comment – DiegoMath Apr 17 at 22:44
• So by taking the absolute value of the original expression, does this mean that the series is absolutely convergent? – Jeremiah Apr 17 at 22:49
• @Jeremiah Indeed so, and thus it also converges. – DonAntonio Apr 17 at 23:59

We know that

$$\int_0^{\infty} \dfrac{sin(x)}{x} \ dx$$ and therefor $$\sum_{n=0}^{\infty} \dfrac{sin(n)}{n}$$

converges.

There are many detailed proofs on the web so I will not focus on proving that.

But you can see that:

$$|\dfrac{sin(n)}{2^n}| \leq |\dfrac{sin(n)}{n}|$$

And therefor it must be convergent.


text:
# Massless particles and time synchrony

Someone once tried to explain to me why neutrino oscillation implies that neutrinos have mass, and I understood it as follows:

1. Change requires time.

2. Massless particles travel at the speed of light.

3. Objects travelling at the speed of light do not experience. time

4. Therefore, if neutrinos oscillate, then they must have mass.

That argument seems to correspond to the most highly rated answer to Why do neutrino oscillations imply nonzero neutrino masses?.

Following from that argument, I considered that a massless particle than then be described as a line connecting two points in 3-space: the point where the particle was emitted, and the point where it was absorbed. Then time synchronization can be defined as follows: two events E1 and E2 occur at the same time if a photon emitted by E2 is absorbed by E2. But then I considered the scenario of an observer that is stationary with respect to a mirror t light-seconds away. When the observer views its own reflection, it will see itself as it was 2t seconds in the past. This contradicts the definition of time synchrony above, which requires that the light emission and observation take place at the same time (unless the process of reflection takes time, but then the time to reflect a photon depends on how far the mirror is from the observer, which also doesn't make sense). So clearly this understanding is faulty.

What is my mistake here?

This argument isn't correct. A photon does change phase as it travels.

"Objects traveling at the speed of light do not experience time" is a common idea, but there is no such thing as a frame of reference traveling at the speed of light, so you can't consistently talk about what something traveling at the speed of light experiences.

See How does a photon experience space and time?, in particular, my answer


text:
# Colloque

24 novembre 2017 de 15 h 30 à 17 h 30 (heure de Montréal/HNE) Sur place

### Complex analysis and 2D statistical physics

Over the last decades, there was much progress in understanding 2D lattice models of critical phenomena. It started with several theories, developed by physicists. Most notably, Conformal Field Theory led to spectacular predictions for 2D lattice models: e.g., critical percolation cluster a.s. has Hausdorff dimension $91/48$, while the number of selfavoiding length $N$ walks on the hexagonal lattice grows like $(\sqrt{2+\sqrt{2}})^N N^{11/32}$. While the algebraic framework of CFT is rather solid, rigorous arguments relating it to lattice models were lacking. More recently, mathematical approaches were developed, allowing not only for rigorous proofs of many such results, but also for new physical intuition. We will discuss some of the applications of complex analysis to the study of 2D lattice models.


text:
# Science and Politics

Discussion in 'Ethics, Morality, & Justice' started by Bowser, May 28, 2016.

1. ### BowserLife is Fatal.Valued Senior Member

Messages:
7,506
Does science have a political identity/agenda? I understand that science is often used to further political agendas, but I'm curious if science, in general, is political. Is it, or should it be, apolitical?

3. ### exchemistValued Senior Member

Messages:
7,329
I do not see how the study of nature can itself be political.

However the study of nature can lead to findings which have political implications, from climate change to a cure for AIDS, or the atom bomb.

And of course politicians sometimes try to co-opt science to further their own ends, because of of its air of dispassionate authority, as far as the public is concerned.

Last edited: May 28, 2016
Billy T and Yazata like this.

5. ### YazataValued Senior Member

Messages:
4,883
Physical science doesn't. (Or at least it shouldn't.) It should be based around the application of logic and epistemology to objective physical facts.

But "social sciences" oftentimes seemingly do. (Sociology in particular.) The social sciences were created in the 19th century as part of an Enlightenment-inspired faith that if the methods that the Newtonians were using so successfully in physics could just be applied to society and to social problems, all forms of obscurantism might be swept away and all manner of social problems solved. So from its outset, social science has has an implicit utopian social change agenda, along with the conviction that certain kinds of ideas are obscurantist and certain kinds of goals "progressive".

But sadly, it has never worked out as intended. Perhaps one of the biggest problems that the social sciences have faced is that there apparently aren't any simple mathematical "laws" of history and social interactions analogous to the laws of physics. So the whole idea of applying "the scientific method" in the social sciences (always a procrustean bed from the outset) seems to have been misconceived. But now that careers and university departments ride atop these subjects, they have institutional mass and aren't going away any time soon. (It's reminiscent of theology in that respect, perhaps.)

There's the descriptive/prescriptive distinction. Science seems to me to be largely be a descriptive pursuit. That would seemingly make it essentially apolitical. It describes how physical reality behaves. It doesn't necessarily tell us how things should be. To arrive at those kind of conclusions we would need to apply all kinds of moral and psychological values to the raw data of science. And science doesn't seem to be in any position to tell us what we should desire, how the future should unfold, or how we should behave. (Science might be on firmer ground telling us how we should behave as to achieve a particular end, but it doesn't seem to be in the position to tell us what our ends should be.)

Ethics has tried to generate no end of metaethical theories that purport to explain how we should make moral judgements (by considering consequences? by maximizing virtues? by the application of deontological logic to moral rules?) but that's philosophy as opposed to science and it remains controversial.

7. ### wegsMatter & Pixie DustValued Senior Member

Messages:
3,368
With the way politicians use virtually anything to bolster their fan club, it wouldn't be surprising if they find ways to exploit science for their own agendas. It would be unfortunate if the general public couldn't tell the difference between a politician's spin on science, and what science is actually trying to ''tell us.''

8. ### PhysBangValued Senior Member

Messages:
2,422
The science that we have access to can only be done by humans. As such, it must be influenced by politics. What gets researched, how it gets researched, these are political decisions.

That being said, it can be politically expedient to be "as objective as possible". What is "objective" is something that is not always the pure ideal we imagine and is always tainted by subjectivity. However, that doesn't mean that science is a lost cause or "merely" the product of politics.

People who try to make science apolitical are really just trying to get science to support the political status quo and are thus advocating conservative politics. For example, see all the people who advocate for apolitical science in the field of climate change.

9. ### iceauraValued Senior Member

Messages:
26,863
Politics, social concerns generally, sometimes also affects scientists in their evaluation of the state or current role of some field of science - even their own, in which they are expert. Especially their own, in some common situations. This is especially noticeable in new fields of great practical import and heroic social possibility, that are technologically "sweet" in some sense and/or offer great rewards to somebody, but it occurs generally.

One cannot get a reasonable evaluation of the safety and benefits of deepwater or Arctic fossil fuel drilling from the cutting edge researchers in the field, for example. Similar considerations apply to nuclear power, "food science" and other agricultural innovations, high-tech medical advances (especially surgical), genetic engineering, new software and other aspects of computerization, and the like.

A surprising thing, for the newcomer to a field, is the nature of the errors and delusions that can - and commonly do - afflict scientific experts in such situations. They are not misjudgments of deeply subtle matters - the pros are good at those, and properly humble etc. They are intellectual pratfalls. They are the best and the brightest using chunks of this funny new stuff they made - plutonium - for doorstops and paperweights, curiosities they hand to visitors to feel the odd warmth given off. They are the consensus of the best and brightest in the field approving the adulteration of the entire food supply of a continent with engineered transfats and artificial sweeteners without having checked their effects on metabolism. They are collections of the very best and brightest scientists on the planet endorsing, in public, the following statement: "It is the scientific consensus that GMOs are safe".

This is the reason for the existence of the overriding and central proscription of the Hippocratic Oath: "First, Do No Harm". An inexperienced person might wonder at the necessity of making such a big deal of something so obvious - older people do not.

10. ### TiassaLet us not launch the boat ...Staff Member

Messages:
35,512
Wandering Reflections

Click for incongruity.

Perhaps strangely, religion makes for an excellent juxtaposition.

There is in human behavior and psychology a basic brain impulse, having to do with creativity and comparison and the prevalence of basic living priorities, that we would describe as a religious impulse.

Kharkovli, for instance, explains―

The conception that "Sufism is the inner component of religion", too, should be acceptable enough if it is seen from enough examples that religion is often mainly an accretion of superficialities around an ancient core which may be reclaimed ....

(176)

―and this is well enough if we leave it solely to the interpretation of religious belief. More objective consideration would question the "ancient core which may be reclaimed", both in the context of the core itself for detail of its composition, and also what constitutes a reclamation.

The ancient core, as such, seems to simply be a useful cognitive and behavioral adaptation. That set of cognitive processes and behavioral traits is at least partially, though not likely wholly, within our capacity to control. The outcomes of that shaping and controlling are what we tend to think of as religion.

There are the basic "religious" impulses and behaviors, and then there is "religion" as we contextualize it whenever we use the word.

And this is the juxtaposition.

Science simply is. The basic concept of science represents a fundamental means of inquiry; the only grounds for doubt at this point would be to complain that inquiry, in and of itself, is inherently extraneous, though the evolutionary context of the simple, basic fact that the human species and its concomitant societal endeavor still exists would proscribe the range of extraneity in such a manner as to preclude inherentness.

Rarely do people use the word in this context. Everything else is accretion.

We all get what the question means; the point is not to doubt the question.

But the basic concept of science precludes a political identity or agenda. Identity and agenda are subordinate to external influence.

To wit, in the private sector science is intended to make money. That's it. That's all there is to it. That is what sets the priority for what gets explored and pursued.

In other settings, science is ostensibly attuned to this or that purpose―curing cancer, developing clean energy, figuring out what is taking place at the leading edge of an expanding Universe, &c.―but even then is subject to the people deciding what gets explored and pursued. At a very basic level, perhaps you and I perform an experiment; the result is hardly a world-changing outcome, but what do we do next? Perhaps we propose different subsequent experiments; these proposals would be subject to our own priorities. Perhaps we leave it alone and go do other things, either together or separately, and those decisions would be subject to our own priorities.

Somewhere in between "curing cancer" and collaborators looking at their results and figuring out what to do next is a context or valence corresponding to the question of whether science has a political identity or agenda. It's a fairly specific context, but remains somewhat undefined.

Generally speaking, "science should be apolitical", but insofar as what we know and what we learn affects the decisions we make, "science becomes inherently political".

The important thing is the becoming.

Because that, too, is us. Not just you and me. People.

Much of the politics about science are assigned. Some of the seemingly inherent questions present themselves as obvious; if we thought we could pursue a gun big enough to shatter a planet that would have to be installed in a space station the size of a small moon, should we? There's a pretty good argument against.

To the other, there are some traditional ideas in our society that keep running up against stubborn reality, and science often seems an easy scapegoat. Even the observable is subject to doubt among some of these.

Science becomes political because we perceive a stake in defining it so.

The question does arise; we need not doubt the question.

Look, humans have creative and comparative faculties; we tell stories; a mythic comparison to abstract perfection is inevitable. There is, however, reasonable question whether using that comparison to ... er ... ah ... well, there are a bunch of issues that could fill that slot.

But it's true. If carbon dating was as wrong as my daughter's maternal grandfather needs it to be in order to accommodate his belief, your mobile phone wouldn't work. Masturbation doesn't really grow hair on your palms or make you go blind. I mean, sure, I guess the latter if your vascular condition is poor enough to stroke out while stroking off, but generally speaking, no. There really are genotypic XY human beings displaying XX phenotype; it is true that our traditional roles for people do not find scientific support. It is true that according to science, there is no reason marijuana should have been Schedule I while methamphetamine was Schedule II; there is no scientific support for the disparity in the former five-for-five federal crack standard.

Here's a controversial one: It is true science clearly indicates it is unwise for the health of a general population to entertain wilful abstention from vaccination without specific medical necessity. The political question there essentially considers one's right to assert oneself as a dinosaur as well as require that of everyone else as well. The science says what the science says, and if the question, "How do we live longer, less suffering lives?" is somehow "political", we must also recognize that at some point the politics oppose the human endeavor itself. It seems easier to simply disregard that valence of politics. Probably safer, too.

Science is science. What we do with it introduces the question of political identity and agenda.
____________________

Notes:

Kharkovli, Adilbai. "Those Astonishing Sufis". Sufi Thought and Action. Ed. Idries Shah. London: Octagon Press, 1990.

11. ### wellwisherBannedBanned

Messages:
5,160
To publish in science you need lots of resources. This is why more studies will get published from the prestigious places with deep pockets. The problem with this is, science is not self sufficient, when it comes to resources. It needs the assistance of outside agencies for funding; business, government and private. This means science and the right to publish, can make one beholden, to those who provide the needed resources to allow one to close the science deal.

Those who provide resources are happier if the money spent, agrees with their POV. They are not happy of the research purposely makes them look bad or stupid. Nobody who believes in manmade global warming, and has money to spend, will give that money to anyone who is trying to refute this. The opposite is also true. If the money is not there, then scientists can't work and publish. If you are denied resources, this research will never be taken serious or publish in the best journals.

If you were a billionaire and had money to spend on science research, you will try to spend it on things you like, you believe in, or you see as a potential money maker. You will not invest in things that go against your principles, undermine your opinions or make you lose money. This has the impact of stacking the preponderance of the data and publications, in the direction of funder's choice. A cigarette company will invest in science, but it will not pay for research and publications, than shoots their company or industry in the foot.

Science would be better served if it had access to its own money, that had no strings. This way mercenary science would not be a necessary default to earn a good living. The other way is, science could be modified, not to need as much resources to do science and publish. This minimizes the impact of deep pockets. This would take more competence that does high resource requirements. Anyone can do science when you has lots of resources. Fewer can do good science with far less.

Science that is less political, will tend to have more freedom to pursue all paths. This will be more balanced science. But once you see a political divide connected to any area of science, assume a stacked deck, based on who has deep pockets, and what they wish to hear.

In another forum, there was a topic about the human race and species. In biological cataloging, humans are treated differently than other animals in terms of cataloging, such as species and sub-species. One can go to the web site Ancestry.com and do a DNA test that will tell you your ethnic make-up. Humans have regional genetic differences, like birds that have been brought to the new world. The dual standard is based on the impact of PC deep pockets and not science consistency. Such studies are not important to business, since there is no money to be made. These resources tend to come from government; PC science.

The human standard is subjectivity better for appeasing racial tensions, while the animal standard makes evolution subjectively appear more clear cut due to the greater variety of distinctions. If you had one standard, classes of birds may be lumped into one species, like humans, making evolution harder to see. Or it can make differences between humans be defined as subspecies, like with birds, which is taboo for those who need demographic based votes, based on current sales pitches.

Science is afraid to step in and settle this, since it needs funding and knows how deeper pockets, if disappointed, will react; paid demonstrators and the black ball list.

Last edited: May 30, 2016
12. ### YazataValued Senior Member

Messages:
4,883
That's true for experimental work, especially in resource intensive areas of inquiry. But I think that a lot can be done, provided that experimentalists and observers make their data sets publicly available. (Complete raw data sets, not 'adjusted' data sets that already have thumbs pressing with unknown force on the scale.) I know of a researcher at one of my old universities, who published some papers on gravity waves using data made available by Ligo. NASA's orbiting Kepler observatory has made huge data sets available to extra-solar planet researchers all around the world. enabling them to make analyses and propound hypotheses based on Kepler data.

What makes me more concerned is when the 'peer-review' process weeds out papers expressing unpopular points of view. We've seen that with "climate science". There have even been attempts to black-list certain authors, threatening boycotts of particular journals if anything by those authors is printed.

Last edited: May 30, 2016
13. ### C CConsular Corps - "the backbone of diplomacy"Valued Senior Member

Messages:
1,882
In idealized context it should be apolitical. Mediating agencies that convey "what _x_ scientific output means to the public" can be political or ideological. IOW, the interfaces between science and society abroad can dispense their own interpretations and prescriptions based on discoveries, research data, theories, etc. To the extreme of even a pseudoscience movement being born from such. Scientists themselves can be among those contributing to such transitional "border country". An historic example would Francis Galton, the cousin of Charles Darwin, who was a founder of eugenics.

Also, in personal life scientists can obviously be political, philosophical, religious, etc. Which might raise a peripheral question of can science truly outrun its human components, be distinct from their private passions and preferences. How "real" can such an abstract entity be if its activities cease without people, or are utterly dependent upon beings with similar functional characteristics? The answer would be dichotomization -- of personal interests being set aside in the workplace, of properly trained individuals being recruited to behave / operate according to the scheme and standards of a science.

Last edited: May 30, 2016
14. ### iceauraValued Senior Member

Messages:
26,863
To those with a political agenda, peer review always looks like a conspiracy.

When physical reality has a political bias, as during fascist movements or religious revivals or other mass delusions, science will appear to have one to the exact extent that it doesn't.

15. ### wellwisherBannedBanned

Messages:
5,160
During the energy crisis of the Jimmy Carters years of the 1970's, there was a political clammer for the development of alternate energy, due to rising costs of oil. This was partially driven by environmentalist movements via the Administration. The government poured a lot of money into all types of energy R&D and development.

In 20/20 hindsight, they could have just as well invested in alternate oil and gas explorations and some solar and achieve the modern status quo of 2016. However, there was a lot of money earmarked to do all types of blue sky energy science that made environmentalists, within in the masses, feel good. I did some of that research. I worked on coal liquefication via extrusion, high energy heat sink targets, and using low melting point waxes for passive solar energy storage.

The bulk of that blue sky research may never had happened, if there was not this political carrot and stick. Much of that science, like government, was well intended, but useless since it was not economically feasible. Science does not care and protest, but will migrate, wherever the resources appear, to appease the needs of the deep pockets, and get a good job.

I would like to see Congress allocate a lump sum to science. Once the money is allocated, the details of allocation will be off limits to the politicians; lawyers, practicing quid prop quo. The funds will be controlled by a council of scientists, chosen by their peers, whose job is to meter it out the resources, based on the principles of discovery and social need. They should set aside 10% for blue sky research since you never know when such discovery becomes timely. For example, in the auto industry, concept car designs, from 50 years ago, find new life, today.

One way to do this is to determine the average funding used by those who win the Nobel prize. This is all any resources that should be needed to do pinnacle science. Any more than that is about politics and incompetence. This allocation limit will make the resources go farther, so more scientists have the front door to publication, via 360 science where all angles are looked at.

16. ### billvonValued Senior Member

Messages:
14,137
And it worked. From Wikipedia:
=================
Renewable energy in the United States accounted for 13.44 percent of the domestically produced electricity in 2015,and 11.1 percent of total energy generation. As of 2014, more than 143,000 people work in the solar industry and 43 states deploy net metering, where energy utilities buy back excess power generated by solar arrays.

Renewable energy reached a major milestone in the first quarter of 2011, when it contributed 11.7 percent of total U.S. energy production (2.245 quadrillion BTU of energy), surpassing energy production from nuclear power (2.125 quadrillion BTU). 2011 was the first year since 1997 that renewables exceeded nuclear in US total energy production.

17. ### iceauraValued Senior Member

Messages:
26,863
Multiplied by the number of available students and scientists, and the duration involved in the Nobel research (including of course the education received, publication support, teaching and other salaries involved, etc), and the resources employed (existing labs, facilities of one kind and another, etc). And directed toward the kinds of research, the categories, that produce Nobel prizes. Of course.

Ok, but I don't think the US has enough money budgeted that way. That kind of wild and profligate boost in funding for non-military and economically useless research is going to be a hard sell in the current US Congress.

18. ### exchemistValued Senior Member

Messages:
7,329
Impressive statistic, given the size of the US economy and its demand for energy. But tell me, was this "total energy production" the total of electricity generation only, or some more inclusive measure of energy produced?

19. ### SarkusHippomonstrosesquippedalo phobeValued Senior Member

Messages:
7,783
Due to the unfortunate matter that reality is not quite so amenable to making all significant discoveries cost the same, this would be an utter failure due to making cheap science less efficient while making higher-priced science unachievable due to financial constraints.
For example, how much do you think it has cost to discover the Higgs boson, given that CERN cost $4.75 billion to build and c.$1 billion to run each year?