text:
Public Group

This topic is 3621 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I know some C and a bit of C++. But some concepts, i do not get it. What means abstraction in C++ context? What is advantages of encapusulation? I just see it as waste of memory and cpu power. Thanks in advance.

##### Share on other sites
Abstraction is a means for removing fine grained details and placing them behind higher level concepts. For example, taking a commonly used set of procedures and generalizing them into a function that can be called instead is abstraction.

Here is an example, let's say we want to do a lot of conversions from degrees to radians. I could either litter my code with the corresponding calculations or I can wrap the concepts in functions and call those instead.

template <class variable_type>
variable_type toDegrees(variable_type val){
return val*(180.0/PIE);
}

template <class variable_type>
return val*(PIE/180.0);
}

...elsewhere...

vs littering your code with this every time you need to make a conversion:

ourDegrees = val*(180.0/3.14159265358979323846);

We've technically abstracted the value PI (cutely referred to as PIE) and the functions themselves in the first example and none if it in the second. Clearly the first example where we actually call the functions is much easier to read and deals with the more abstract idea of calling a well named function to perform the task instead of duplicating code.

This is a relatively simplistic example, if our functions were 100 lines, let's say, it would be foolish to replicate that code everywhere we needed it. But the main idea of abstraction isn't exactly the same as code re-use, the important thing about the concept of abstraction is that you take implementation details and hide them behind a more simplistic interface which leads to your next question.

What are the advantages of encapsulation? Well, there are a few. Encapsulation is the idea of holding similar information in a structure and it is often used alongside the term Data Hiding (abstraction is a similar idea, but used more broadly) which is the idea that you should produce an interface for what you are doing and hide the actual data structures that represent the tasks you request.

Let's say we come up with a more efficient method of performing radian and degree conversions somehow. If we have the equation littered everywhere in code it becomes a nightmare to update the way we do it. Similarly if you reveal implementation details of something you immediately incur a dependency on a method of doing that thing. Instead if you can provide a common interface you are given the freedom to change the implementation and as long as it performs an equivalent task there is no reason for the calling code to understand exactly how a task is being done.

Next, it makes it a lot easier to read code if you present a common level of abstraction at each juncture in your application code. For example, in the main loop of your program you will want to have only the very highest level of abstraction in your function calls. You shouldn't be worried about setting and checking state values directly. You should instead be controlling the flow of information and delegating to the proper functions to dictate the order things are done.

The next level down you might worry about the organization of things that you're going to be rendering, gathering input from the user and passing that off to the appropriate controls, and calling updates on the state of objects one more level down.

The next level down we've got a lower level of abstraction where we actually call the draw functions of the individual objects, pass the input to the specific structures and distribute that accordingly.

The next level down we may worry about individual rendering calls to whatever rendering system we use, acting upon the input given, updating the application state etc.

The final level we have the most implementation specific stuff going on, draw calls to opengl or directx and other things of that level of concern. The further down you get the wider concerns branch out.

Here is a diagram:
     Abstract        /\    .       /\/\   .      /\/\/\  .      /\/\/\/\ .     Specific

As you can see in this pyramid diagram, the number of things you have to worry about at each junction is much lower than if we re-wrote the diagram flat (which is what happens when we impose no data hiding or encapsulation.) If we look at this in terms of concerns at each level in this example we can see each branch as being dependant upon what is directly under it.

Each branch would be a problem domain we have to be aware of to use the current level properly. So at the top we need to be aware of two branches and no more. On the next level down of each of those branches in this diagram we only need to be aware of two things as well and so on. In this way a problem can be thought of as a series of smaller problems which can be more easily analyzed. Obviously some levels would have more and fewer than two branches each, but you can contrast this with the following (which has the same number of dashes as the above diagram each representing a concern. The only difference is that we flatten it out so that we assume the user must be well versed in the -entire system- in order to be effective in making modifications.)

All concerns  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

The benefits of these ideas is much more clearly conveyed when you consider projects above the size of entry level code examples to display language ideas. Basically anything over 500 lines and you're going to immediately notice huge issues which may not cause you too much grief until you go over 1000 lines or so. From there it's almost exponential slow-down of implementation as you work on a teetering Jenga(tm) tower of code. This is assuming you take the stance that data hiding/encapsulation and abstraction are a "waste of memory and cpu power." which is in itself a pretty daft over-simplification.

Often you can improve performance by properly wrapping similar concepts together in a more abstract interface as common things can be simplified by giving the compiler hints as to what and how it can optimize. Beyond this, you should always focus on maintainability of code first and run-time second. Where performance is needed additional optimization may be required, but you should only favor performance over maintainability (which is closely related with readability) in mission critical low-level code that has a properly abstracted interface so that it can be easily swapped out when you have to port to other systems.

These topics are all much larger than I have presented here, but this should get you an answer to your question. For further reading: Wikipedia Knows and click through to things such as scope, transparancy and inheritance articles.

[Edited by - M2tM on January 10, 2009 3:35:11 AM]

##### Share on other sites
Quote:
 Original post by cmorsoftI know some C and a bit of C++.But some concepts, i do not get it.What means abstraction in C++ context?

The same thing it means in everyday English.

Quote:
 What is advantages of encapusulation? I just see it as waste of memory and cpu power.

What is the advantage of cleaning your room and putting things away in boxes? I just see it as a waste of time.

##### Share on other sites
Quote:
Original post by Zahlman
Quote:
 Original post by cmorsoftI know some C and a bit of C++.But some concepts, i do not get it.What means abstraction in C++ context?

The same thing it means in everyday English.

Quote:
 What is advantages of encapusulation? I just see it as waste of memory and cpu power.

What is the advantage of cleaning your room and putting things away in boxes? I just see it as a waste of time.

Yeah really, i mean my mom keeps bitching at me about it ;).

With use of encapsulation and organizing, it makes it profoundly easier to manage, and update your code. It also gives re usability, and is a fundamental part of OOP.

1. 1
2. 2
3. 3
Rutin
20
4. 4
khawk
14
5. 5

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633655
• Total Posts
3013186
×


text:
# Subtraction Law of Limits

## Formula

$\displaystyle \large \lim_{x \,\to\, a} \normalsize \Big[f{(x)}-g{(x)}\Big]$ $\,=\,$ $\displaystyle \large \lim_{x \,\to\, a}{\normalsize f{(x)}}$ $-$ $\displaystyle \large \lim_{x \,\to\, a}{\normalsize g{(x)}}$

The limit of subtraction of two functions as the input approaches some value is equal to difference of their limits. It is called as subtraction rule of limits and also called as difference property of limits.

### Proof

$x$ is a variable and two functions $f{(x)}$ and $g{(x)}$ are developed in terms of $x$. The limits of $f{(x)}$ and $g{(x)}$ as $x$ approaches $a$ are written mathematically as follows.

$(1) \,\,\,\,\,\,$ $\displaystyle \large \lim_{x \,\to\, a}{\normalsize f{(x)}}$ $\,=\,$ $f{(a)}$

$(2) \,\,\,\,\,\,$ $\displaystyle \large \lim_{x \,\to\, a}{\normalsize g{(x)}}$ $\,=\,$ $g{(a)}$

#### Limit of Subtraction of functions

Find the limit of subtraction of the functions $f{(x)}$ and $g{(x)}$ as $x$ tends to $a$. In this case, it is taken that the function $g{(x)}$ is subtracted from the function $f{(x)}$.

$\displaystyle \large \lim_{x \,\to\, a}{\normalsize \Big[f{(x)}-g{(x)}\Big]}$

#### Evaluate Limit of Subtraction of functions

Substitute $x$ is equal to $a$ to find the limit of subtraction of the function as $x$ approaches $a$.

$\implies \displaystyle \large \lim_{x \,\to\, a}{\normalsize \Big[f{(x)}-g{(x)}\Big]}$ $\,=\,$ $f{(a)}-g{(a)}$

#### Replace the Limits of functions

Now, replace the values of $f{(a)}$ and $g{(a)}$ in limit form.

$\,\,\, \therefore \,\,\,\,\,\, \displaystyle \large \lim_{x \,\to\, a}{\normalsize \Big[f{(x)}-g{(x)}\Big]}$ $\,=\,$ $\displaystyle \large \lim_{x \,\to\, a}{\normalsize f{(x)}}$ $-$ $\displaystyle \large \lim_{x \,\to\, a}{\normalsize g{(x)}}$

Therefore, it is proved that the limit of subtraction of two functions as input approaches some value is equal to difference of their limits. It is used as a formula in calculus to find limit of two functions which are involved in subtraction.

Latest Math Topics
Latest Math Problems
Email subscription
Math Doubts is a best place to learn mathematics and from basics to advanced scientific level for students, teachers and researchers. Know more

format: plain


text:
# What is the name of CoF_2?

Jan 30, 2017

Cobalt Floride. or Cobalt diFloride.

#### Explanation:

The most common form of Cobalt has a charge of +2 so can bond with two Florine atoms.

To be more precise this compound could be named Cobalt +2 Floride . A more common name would be Cobalt di Floride.

Feb 8, 2017

The name is cobalt(II) fluoride.

#### Explanation:

Cobalt is in the $\text{d}$-block of elements, so it is a transition metal.

Here are the steps for deriving the name of a compound of a transition metal.

Step 1. Write the name of the transition metal

This gives: "cobalt".

Step 2. Add the name of the nonmetal with the ending "-ide"

This gives: "cobalt fluoride".

Step 3. Use the charge on the non-metal to find the charge on the transition metal

The charge on each $\text{F}$ is -1, for a total charge of -2.

The charge on the $\text{Co}$ must be +2.

Step 4. Write the charge on the non-metal as Roman numerals in parentheses immediately after (no spaces) the name of the metal.

This gives the name: cobalt(II) fluoride.


text:
All

We uncover a topological classification applicable to open fermionic systems
Lindbladians' can be captured by a non-Hermitian single-particle matrix which
describes internal dynamics as well as system-environment coupling. We show
that this matrix must belong to one of ten non-Hermitian Bernard-LeClair
symmetry classes which reduce to the Altland-Zirnbauer classes in the closed

Quantum Circuit Transformation Based on Simulated Annealing and Heuristic Search. (arXiv:1908.08853v1 [quant-ph])

with ideal properties like full connectivity, noise-freedom and arbitrarily
long coherence time. In Noisy Intermediate-Scale Quantum (NISQ) devices,
however, the number of qubits is highly limited and quantum operation error and
qubit coherence are not negligible. Besides, the connectivity of physical
qubits in a quantum processing unit (QPU) is also strictly constrained.
Thereby, additional operations like SWAP gates have to be inserted to satisfy

Training the Quantum Approximate Optimization Algorithm without access to a Quantum Processing Unit. (arXiv:1908.08862v1 [quant-ph])

In this paper, we eliminate the classical outer learning loop of the Quantum
Approximate Optimization Algorithm (QAOA) and present a strategy to find good
parameters for QAOA based on topological arguments of the problem graph and
tensor network techniques. Starting from the observation of the concentration
of control parameters of QAOA, we find a way to classically infer parameters
which scales polynomially in the number of qubits and exponentially with the

Testing of Generalized Uncertainty Principle With Macroscopic Mechanical Oscillators and Pendulums. (arXiv:1903.03346v2 [quant-ph] UPDATED)

Recent progress in observing and manipulating mechanical oscillators at
quantum regime provides new opportunities of studying fundamental physics, for
example, to search for low energy signatures of quantum gravity. For example,
it was recently proposed that such devices can be used to test quantum gravity
effects, by detecting the change in the [x,p] commutation relation that could
result from quantum gravity corrections. We show that such a correction results

Semi-Quantum Money. (arXiv:1908.08889v1 [quant-ph])

Private quantum money allows a bank to mint quantum money states that it can
later verify, but that no one else can forge. In classically verifiable quantum
money - introduced by Gavinsky [Gav12] - the verification is done via an
interactive protocol between the bank and the user, where the communication is
classical, and the computational resources required of the bank are classical.
In this work, we consider stateless interactive protocols in which the minting

Simulation of Quantum Many-Body Systems on Amazon Cloud. (arXiv:1908.08553v1 [cs.DC])

Quantum many-body systems (QMBs) are some of the most challenging physical
systems to simulate numerically. Methods involving tensor networks (TNs) have
proven to be viable alternatives to algorithms such as quantum Monte Carlo or
simulated annealing, but have been applicable only for systems of either small
size or simple geometry due to the NP-hardness of TN contraction. In this
paper, we present a heuristic improvement of TN contraction that reduces the
computing time, the amount of memory, and the communication time. We

Variational-State Quantum Metrology. (arXiv:1908.08904v1 [quant-ph])

Quantum technologies exploit entanglement to enhance various tasks beyond
their classical limits including computation, communication and measurements.
Quantum metrology aims to increase the precision of a measured quantity that is
estimated in the presence of statistical errors using entangled quantum states.
We present a novel approach for finding (near) optimal states for metrology in
the prescence of noise, using variational techniques as a tool for efficiently

Eigenstate thermalization hypothesis and integrals of motion. (arXiv:1908.08569v1 [cond-mat.stat-mech])

Even though foundations of the eigenstate thermalization hypothesis (ETH) are
based on random matrix theory, physical Hamiltonians and observables
substantially differ from random operators. One of the major challenges is to
embed local integrals of motion (LIOMs) within the ETH. Here we focus on their
impact on fluctuations and structure of the diagonal matrix elements of local
observables. We first show that nonvanishing fluctuations entail the presence
of LIOMs. Then we introduce a generic protocol to construct observables,

Predicting Features of Quantum Systems using Classical Shadows. (arXiv:1908.08909v1 [quant-ph])

Predicting features of complex, large-scale quantum systems is essential to
the characterization and engineering of quantum architectures. We present an
efficient approach for predicting a large number of linear features using
classical shadows obtained from very few quantum measurements. This approach is
guaranteed to accurately predict $M$ linear functions with bounded
Hilbert-Schmidt norm from only $\log (M)$ measurement repetitions. This
sampling rate is completely independent of the system size and saturates

Nonlinear Schr\"odinger equation in foundations: summary of 4 catches. (arXiv:1602.03772v2 [quant-ph] UPDATED)

Fundamental modifications of the standard Schr\"odinger equation by
additional nonlinear terms have been considered for various purposes over the
recent decades. It came as a surprise when, inverting Abner Shimony's
observation of "peaceful coexistence" between standard quantum mechanics and
relativity, N. Gisin proved in 1990 that any (deterministic) nonlinear
Schr\"odinger equation would allow for superluminal communication. This is by
now the most spectacular and best known anomaly. We discuss further anomalies,


text:
# How do I set up LUA scripts on my OpenTX radio?

I’m looking at how to use LUA scripts and was wondering how to configure them I am OpenTX radio.

Thanks.

More info: at present, I don’t want to write my own scripts, only run scripts that I can find online, such as VTX control.

• This is a little vague, can expand on what you are wanting to do? i.e. are you just installing existing LUA scripts such as VTX control or writing your own scripts? Apr 16 '20 at 1:06
• @PaulKendall sorry - updating now. Apr 16 '20 at 1:07

• Download LUA scripts you need, for VTX control in Betaflight its: https://github.com/betaflight/betaflight-tx-lua-scripts/releases
• Unzip it, you will have folders BF, SCRIPTS, SOUNDS
• You need to copy these folders to the SD card root directory.
• To do this put you TX to bootloader mode and connect a USB cable to it and access the SD card
• Or you can just take SD card out of TX and use card reader to connect it to the PC If prompted during the install replace/merge existing on SD card files.
• Now put the SD Card back or disconnect the USD cable and power up the TX.
• You need to go to SD Card page on OpenTX now. Depending on the version and the TX itself it can be in different places.
For example I have QX7 and OpenTX 2.3.5, I need to hold down MENU button and then hit PAGE once.
• Go to BF folder and execute (by long pressing) bf.lua. Now use PAGE button to navigate to VTX page.

Additionally if you don't want to go to SD Card each time you can setup telemetry screen:

• Go to the Telemetry page of your model.
• Find a free screen (Screen 1, 2, etc.)
• Select "Script" type for it
• Then on the next column you select which script to display, select bf

Now you can run this LUA script from the Home page of the model.

Press "PAGE" button till the telemetry show up and then use "PAGE" to scroll to the screen you selected, like Screen 2, etc.

The only thing is that if you run scripts from TELEMETRY screen, they will use MENU button to skip pages inside the script, instead of PAGE. Because PAGE flips pages between telemetry screens.

If you have error "Script syntax error: not enough memory" you probably didn't check "luac" during the OpenTX install

• That is an excellent walkthrough - thanks very much! Apr 16 '20 at 9:48

Oscar Liang has a really good page for this specific use case https://oscarliang.com/vtx-control/

And Joshua Bardwell has some really good videos that you can follow along with https://www.youtube.com/watch?v=zFb5IJpM1XU


text:
# What is wrong with my raycaster?

This topic is 4772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, After reading some raycasting tutorials I decided an attempt to make one. Starting out I started with something small like only displaying a small room with no wall/object collision. Just rendering and walking. I got this program to work but the room looks so blocky and I can never walk right up to a wall without the program crashing. Can someone please look at my code and correct me? I am programming this in C++ and using the Allegro library. Parts of interest: Maybe something wrong in castRays(); Parts of interest: Maybe something wrong in drawScene();
Module 1: GLOBALS.H

typedef unsigned short USHORT;

const USHORT RAYS_TO_CAST = 640;
const USHORT SCREEN_WIDTH = 640;
const USHORT SCREEN_HEIGHT = 480;
const USHORT HALF_SCREEN_HEIGHT = 240;
const USHORT GRID_SIZE = 64;
const USHORT WALL = 1;
const float FOV = 60.0f;

int map[9][9] =   {{ 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 1, 1 }};

Now for the last file... SOURCE CODE: CAST.CPP
#include <allegro.h>
#include "globals.h"

BITMAP *buffer;
float rayAngle[RAYS_TO_CAST]; // hold all angles to cast with
int rayLength[RAYS_TO_CAST]; // later use this to scale walls

float players_direction = 90.0f; // facing north
int players_x = 128;
int players_y = 128;

// prototypes
void calculateAngles();
void castRays();
void drawScene();

int main(void)
{
// setup
allegro_init();
install_keyboard();
set_color_depth(16);
set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
buffer = create_bitmap(640, 480);
// end of setup

//main loop
while(!key[KEY_ESC])
{
if(key[KEY_UP])
{
players_y--;
}
if(key[KEY_DOWN])
{
players_y++;
}
if(key[KEY_RIGHT])
{
players_direction += 1.0f;
}
if(key[KEY_LEFT])
{
players_direction -= 1.0f;
}

calculateAngles();
castRays();
drawScene();

acquire_screen();
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
release_screen();
clear_bitmap(buffer);

// reset the rayLength array
for(int i=0;i<RAYS_TO_CAST;i++)
rayLength[i] = 0;
}

// clean up
destroy_bitmap(buffer);
// end of clean up

return(0);
}
END_OF_MAIN();

void calculateAngles(void)
{
for(int i=0;i<RAYS_TO_CAST;i++)
{
rayAngle[i] = players_direction + ((i * (FOV / 640.0f)) - (FOV / 2.0f));

if(rayAngle[i] < 0.0f)
rayAngle[i] += 360.0f;
if(rayAngle[i] >=360.0f)
rayAngle[i] -= 360.0f;
}
}
END_OF_FUNCTION(calculateAngles(void));

void castRays(void)
{
int ray_x;
int ray_y;

for(int i=0;i<SCREEN_WIDTH;i++)
{
ray_x = players_x;
ray_y = players_y;

while(map[ray_x/GRID_SIZE][ray_y/GRID_SIZE] != WALL)
{
ray_x += int(GRID_SIZE/4 * cos(rayAngle[i]));
ray_y -= int(GRID_SIZE/4 * sin(rayAngle[i]));

rayLength[i]++;
}
}
}
END_OF_FUNCTION(castRays(void));

void drawScene(void)
{
int sliceSize;

for(int i=0;i<SCREEN_WIDTH;i++)
{
sliceSize = 300/rayLength[i];

vline(buffer, i, sliceSize, (HALF_SCREEN_HEIGHT / 2) -sliceSize, makecol(255, 255, 255));
}
}
END_OF_FUNCTION(drawScene(void));

##### Share on other sites
i think the reason of image being blocky is probabley this

    while(map[ray_x/GRID_SIZE][ray_y/GRID_SIZE] != WALL)    {      ray_x += int(GRID_SIZE/4 * cos(rayAngle[i]));      ray_y -= int(GRID_SIZE/4 * sin(rayAngle[i]));      rayLength[i]++;    }

why do you say rayLength[i]++?the correct way of finding distance should be like once you get out from the while loop ray_x and ray_y represents the intersection point and

distance = abs((ray_y - player_y)/sin(player's facing angle))

another thing is remember coordination starts counting from 0.so you need to -1 or +1 on your ray_x and ray_y.thats probably why is crashing.

##### Share on other sites
Thanks a lot for the reply, it helped me a lot. I was not sure how to check for wall distance. I changed the castRays() function to the following...

void castRays(Player & ref){  int ray_x;  int ray_y;   for(int i=0;i<SCREEN_WIDTH;i++)  {    ray_x = ref.posX;    ray_y = ref.posY;    while(map[ray_x/GRID_SIZE][ray_y/GRID_SIZE] != WALL)    {      ray_x += int(GRID_SIZE * cos(angle[i]*M_PI/180.0f));               ray_y += int(GRID_SIZE * sin(angle[i]*M_PI/180.0f));    }    wall_distance[i] = abs((ray_y - ref.posY) / sin(ref.facing_direction));  }}END_OF_FUNCTION(castRays(Player & ref));

I was forgetting to convert degrees into radians when passing the angles into cos/sin. The program does not look blocky at all now only walls look distorted. Do you still see errors in my code? By the way, I changed my screen dimensions from 640X480 to 320X200

##### Share on other sites
Quote:
 The program does not look blocky at all now only walls look distorted

Distorted in what way? Do you mean the walls seem to curve the further they are from the center of the screen?

Check out the pictures on this page to see if thats the same problem you are having. If it is, the solution is on that page also.

Alan

Alan

##### Share on other sites
Quote:
Original post by Anonymous Poster
Quote:
 The program does not look blocky at all now only walls look distorted

Distorted in what way? Do you mean the walls seem to curve the further they are from the center of the screen?

Check out the pictures on this page to see if thats the same problem you are having. If it is, the solution is on that page also.

Alan

Fishbowl... You need to multiply by 1 / cosine to fix this

http://www.iol.ie/~kellyswd/Patrick/raycaster/
Source code

Also it's better to build a raycaster based on the tan function, as it result in significantly less calulatuions.

##### Share on other sites
Well fishbowl is one of the problems. But I think I still have an error when casting ray_y and ray_x. I'm constantly adding to the variables but don't I add, subtract, etc depending on the angle? Or do I always just add to the rays? I will try to explain what happens when I run the program. The first view looks ok but when I start to move forward, back, or turn it looks like I have other walls in the map when I don't. Hard to explain i'm sorry :/ It seems like the map is as follows...

111111111
100010001
101100001
100000011
100000001
100100010.... etc

Like my casting is not right. I'm sure i'm moving around right. When I turn I add 1.0f or subtract 1.0f from my facing_direction variable and when I walk forward or back i'm incrementing ++ or decrementing -- my posY variable. I don't think anything is wrong with the way i'm drawing to the screen but in case there is something wrong I'll post the drawScene() function which is not large at all.

void drawScene(void){  int sliceSize;  for(int i=0;i<SCREEN_WIDTH;i++)  {    sliceSize = wall_distance[i] / 6;    vline(buffer, i, HALF_SCREEN_HEIGHT-(sliceSize/2), sliceSize, makecol(255, 255, 255));  }}END_OF_FUNCTION(drawScene(void));

I noticed that the larger the number I use for / 6 the more blocky everything seems so I was playing around with values 4 and 6 for this literal constant. Thanks for the help on fishbowl, I was also wondering about that.

Erick

##### Share on other sites
Quote:
 Original post by erickmeisterI'm constantly adding to the variables but don't I add, subtract, etc depending on the angle? Or do I always just add to the rays?

You get the sign from the result of sine or cosine functions, so you always add. Did you see the source of my caster

[SOURCE]              //Ray starting position = player starting position                                rayx = playerx;                                rayy = playery;                                //Calculate ray step x, ray step y.                                //Need to multiply by 1 / cos( fix ) to get rid of fishbowl.                                //Remove it and see what happens.                                stepx = ( Math.cos( getAngle( angle ) ) * ( 1.0 / Math.cos( getAngle( fix ) ) ) ) / 8;                                stepy = ( Math.sin( getAngle( angle ) ) * ( 1.0 / Math.cos( getAngle( fix ) ) ) ) / 8;                                //Set these to minimum value                                wall = 0;                                distance = 1; //Do *NOT* set to 0 or you might get /0 error.                                //Loopp until wall found                                while( wall == 0 )                                {                                    rayx += stepx;      //Ray traverses map in x by stepx.                                    rayy += stepy;      //Ray traverses map in x by stepy.                                    wall = map[ (int)rayx ][ (int)rayy ]; //Have we hit a wall.                                    distance++;         //Increment distance for each step.                                }[/SOURCE]
[/source]

Quote:
 Original post by erickmeisterI will try to explain what happens when I run the program. The first view looks ok but when I start to move forward, back, or turn it looks like I have other walls in the map when I don't..

Are you stopping the cast when you hit a wall?

EDIT - Are you clearing the screen properly? It happens sometimes that you forget the simple stuff.

Maybe a screenshot would help.

Quote:
 Original post by erickmeistervoid drawScene(void){ int sliceSize; for(int i=0;i

I'm not sure what graphics library (homebrew?) you are using but it looks right. You shouln't need to modify the slice size if you do it right, the way I do in in my JAVA raycaster is:

height = 1024 / distance;

distance is just incremented every step, thus I fake the height of the wall.

##### Share on other sites
I appreciate all the help from the forum, to answer the question:

>EDIT - Are you clearing the screen properly? It happens sometimes that you forget the simple stuff.

I think I'm doing it correctly, as for the distance array, I zero it each main loop iteration like this...

 // reset wall_distance    for(int i=0;i<SCREEN_WIDTH;i++)      wall_distance[i] = 0;

I also start it off equal to zero.

When I'm drawing to the screen i'm drawing each vertical line on a bitmap (buffer) then I blit the buffer to the screen. I clear the buffer after each loop iteration like this...
 // show buffer to the screen    acquire_screen();    blit(buffer, screen, 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);    release_screen();    clear_bitmap(buffer);

The clear_bitmap takes care of that part. By the way, i'm using Allegro for my graphics library and coding pure C++.

When checking for my left and right movements i'm manipulating my facing_direction in this way...

if(key[KEY_RIGHT])    {      Hero.facing_direction += 1.0f;    }    if(key[KEY_LEFT])    {      Hero.facing_direction -= 1.0f;    }

Does that look about right? The FOV is 60.0f * so I would not add or subtract by 0.1f right? I think this is ok.

The problem i'm having is something small, when I get home i'm going to look over your source and brief back over the tutorials to see if there is something I missed. Do you see a problem in my degree to radian converting?

  ray_x += int(GRID_SIZE * cos(angle[i]*M_PI/180.0f));  ray_y += int(GRID_SIZE * sin(angle[i]*M_PI/180.0f));

This is just an idea I have to what might be one error in my casting. I start the vector length off at GRID_SIZE which is equal to 64. In the loop I check for walls in this way:
while(map[ray_x/GRID_SIZE][ray_y/GRID_SIZE] != WALL){}`

Of course it finds what grid i'm in but before I cast the first ray should i make sure exactly how far I am from the grid intersections? Then cast by GRID_SIZE? Sorry for so many questions.

Erick

##### Share on other sites

This topic is 4772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628682
• Total Posts
2984206

• 13
• 13
• 9
• 10
• 10


text:
Courses
Courses for Kids
Free study material
Free LIVE classes
More

# NCERT Solutions for Class 10 Science Chapter 11

## NCERT Solutions for Class 10 Science Chapter 11 - Human Eye and Colourful World

Last updated date: 27th Jan 2023
Total views: 382.8k
Views today: 10.76k

Clear concepts and doubts of the chapter The Human Eye and Colourful class 10 with NCERT solutions. These solutions are loaded with exercise questions and answers and approach students in a friendly way. Download NCERT Solutions for Class 10 Maths from Vedantu, which are curated by master teachers. Science Students who are looking for Class 10 Science NCERT Solutions will also find the Solutions curated by our Master Teachers really Helpful. By going through with these solutions, students can effectively prepare for their board and competitive exams.

### Important Topics Covered in Class 10 Science Chapter 11

• Introduction to “The Human Eye”

• Power of Accommodation

• Defects of Vision And Their Correction

• Refraction of Light Through A Prism

• Atmospheric Refraction

• Scattering of Light

Competitive Exams after 12th Science
Watch videos on
NCERT Solutions for Class 10 Science Chapter 11
The Human Eye and The Colourful World L-6 [🧐Score Booster MCQ Quiz] CBSE Class 10 Science Chapter 11
Vedantu 9&10
Subscribe
Share
5.2K likes
58.8K Views
1 year ago
The Human Eye and The Colourful World in One Shot (Full Chapter) CBSE 10 Science Chapter 11(Term 1)
Vedantu 9&10
14.1K likes
285.9K Views
1 year ago
Play Quiz
The Human Eye and the Colourful World in One Shot | CBSE Class 10 Physics Chapter 11 | NCERT Vedantu
Vedantu 9&10
11.1K likes
248.3K Views
2 years ago
Play Quiz
The Human Eye and the Colorful World L2 | Dispersion Through a Prism | CBSE Class 10 Physics | NCERT
Vedantu 9&10
14.8K likes
256.9K Views
2 years ago
Play Quiz
See More
Do you need help with your Homework? Are you preparing for Exams?
Study without Internet (Offline)

## Access NCERT Solutions for Class 10 Science Chapter 11 Human Eye and Colourful World

1. What is meant by the power of accommodation of the eye?

Ans: When the ciliary muscles are relaxed, the eye lens becomes thin. This results in the increase of the focal length, and distant objects are clearly visible to the eyes.

To see the nearby objects clearly, the ciliary muscles contract which makes the eye lens thicker. This results in reduction of focal length of the eye lens, and the nearby objects become visible to the eyes.

Therefore, the focal length can be adjusted by the human eye lens to view both distant and nearby objects on the retina. This ability of the eye refers to the power of accommodation of the eye.

2. A person with a myopic eye cannot see objects beyond $1.2$ m distinctly. What should be the type of corrective lens used to restore proper vision?

Ans: The person can clearly see the objects which are near, but he cannot see the objects beyond $1.2m$ . This arises as the image of an object beyond $1.2m$ is obtained in front of the retina and not at the retina, as displayed in the figure given below.

To correct this defect of vision, a concave lens should be used. The image will be brought back to the retina by the concave lens as shown in the given figure.

3. What is the far point and near point of the human eye with normal vision?

Ans: The near point of the eye refers to the minimum distance of the object from the eye that can be seen clearly without any strain to the eye. This distance is $25$ cm, for a normal human eye.

The far point of the eye refers to the maximum distance to which the eye can clearly see the objects, without getting any strain to the eye. The far point of the normal human eye is at an infinite distance.

4. A student has difficulty reading the blackboard while sitting in the last row. What could be the defect the child is suffering from? How can it be corrected?

Ans: A student has difficulty in reading the blackboard while sitting in the last row. It means that he is unable to see distant objects clearly.

The student is suffering from myopia. This defect can be corrected using a concave lens.

MCQs

1. The human eye can focus objects at different distances by adjusting the focal length of the eye lens. This is due to

a) Presbyopia

b) Accommodation

c) Near-sightedness

d) Far-sightedness

Ans: The correct answer is (b) accommodation,

The focal length of the eye lens is changed by the human eye to see objects situated at various distances from the eye. This is possible due to the power of accommodation of the eye lens.

2. The human eye forms the image of an object at its

a) Cornea

b) Iris

c) Pupil

d) Retina

Ans: (d) The image of an object is formed by the human eye at its retina.

3. The least distance of distinct vision for a young adult with normal vision is about

a) $25m$

b) $2.5cm$

c) $25cm$

d) $2.5m$

Ans: (c) The least distance of distinct vision refers to the minimum distance to see a clear and distinct image. This distance is $25cm$ for a young adult with normal vision.

4. The change in focal length of an eye lens is caused by the action of the

a) Pupil

b) Retina

c) Ciliary muscles

d) Iris

Ans: (c) The curvature of the eye lens is changed by the relaxation or contraction of ciliary muscles.

The focal length of the eyes is changed due to the change in curvature of the eye lens. Therefore, the change in focal length of an eye lens occurs due to the action of ciliary muscles.

5. A person needs a lens of power $-5.5$ dioptres for correcting his distant vision. For correcting his near vision, he needs a lens of power $+1.5$ dioptre. What is the focal length of the lens required for correcting

(a) distant vision?

Ans:  The power $P$of a lens of focal length $f$ is given by the relation

$P=\frac{1}{f}$  ($f$in metres)

Power of the lens used for correcting distant vision $=-5.5D$

Focal length of the required lens, $f=\frac{1}{P}$

$\Rightarrow f=\frac{1}{-5.5}=-0.181m$

The focal length of the lens for correcting distant vision is $-0.181$m.

(b) Near vision?

Ans: Power of the lens used for correcting near vision $=+1.5D$

Focal length of the required lens, $f=\frac{1}{P}$

$\Rightarrow f=\frac{1}{1.5}=+0.667$

The focal length of the lens for correcting near vision is $0.667$m.

6. The far point of a myopic person is 80 cm in front of the eye. What is the nature and power of the lens required to correct the problem?

Ans: The person is suffering from an eye defect called myopia. In this defect, the image of an object is formed in front of the retina. Hence, a concave lens is used to correct this defect of vision.

Object distance, $u=\,infinity=\infty$

Image distance, $v=\,-80cm$

Focal length $=f$

According to the lens formula,

$\frac{1}{v}-\frac{1}{u}=\frac{1}{f}$

$\Rightarrow -\frac{1}{80}-\frac{1}{\infty }=\frac{1}{f}$

$\Rightarrow \frac{1}{f}=-\frac{1}{80}$

$\Rightarrow f=-80cm$ or $-0.8m$

Power of the lens and the focus can be given as:

$P=\frac{1}{f}$ ,( $f$is in metres)

$\Rightarrow P=\frac{1}{-0.8}=-1.25D$

Thus, a concave lens of power $-1.25D$ is required by the person to correct his defect.

7. Make a diagram to show how hypermetropia is corrected. The near point of a hypermetropic eye is $1m$. What is the power of the lens required to correct this defect? Assume that the near point of the normal eye is 25cm.

Ans: A person who suffers from hypermetropia can see distinct objects clearly but faces difficulty in seeing nearby objects clearly. This happens because the eye lens focuses the incoming divergent rays beyond the retina.

This defect of vision can be fixed using a convex lens. A convex lens of a suitable power converges the incoming light in such a manner that the image is formed on the retina, as shown in the given figure.

The person will be able to clearly see the object kept at 25cm (near point of the

normal eye), if the image of the object is formed at his near point, which is given as $1m$.

Object distance, $u=-25cm$

Image distance, $v=-1m=-100cm$

Focal length, $f$

Using the lens formula,

$\frac{1}{v}-\frac{1}{u}=\frac{1}{f}$

$\Rightarrow -\frac{1}{100}-\frac{1}{-25}=\frac{1}{f}$

$\Rightarrow \frac{1}{f}=\frac{1}{25}-\frac{1}{100}$

$\Rightarrow \frac{1}{f}=\frac{4-1}{100}$

$\Rightarrow f=\frac{100}{3}cm=33.33cm=0.33m$

Power,

$P=\frac{1}{f}$ ($f$ is in meters)

$\Rightarrow P=\frac{1}{0.33}$

$\Rightarrow P=+3D$

Thus, a convex lens of power +3.0 D is needed to rectify the defect.

9. What happens to the image distance in the eye when we increase the distance of an object from the eye?

Ans: The size of eyes cannot increase or decrease because of which the image distance remains constant.

When the object’s distance from the eye is increased, the image distance in the eye does not change. The increase in the object distance is balanced by the change in the focal length of the eye lens. The focal length of the eye changes in such a manner that the image is always formed at the retina of the eye.

10. Why do stars twinkle?

Ans: Stars emit their own light and they shine due to the atmospheric refraction of light.

Stars are situated very far away from the earth. Therefore, they are considered as point sources of light. When the light coming from stars enters the earth’s atmosphere, it gets refracted at different levels because of the variation in air density present at different levels of the atmosphere.

When the star light refracted by the atmosphere comes more towards the surface of earth, it appears brighter than when it comes less towards the earth. Clearly, it appears as if the stars are twinkling at night.

11. Explain why the planets do not twinkle?

Ans: Planets do not twinkle because they appear larger in size than the stars as they are comparatively closer to earth. Planets are a collection of many point-sized sources of light. The various regions of these planets produce either brighter or dimmer effect in such a way that the resultant of brighter and dimmer effect is zero.

Clearly, the twinkling effects of the planets are nullified and that is why they do not twinkle.

12. Why does the Sun appear reddish early in the morning?

Ans: During sunrise, the light rays from the sun travel a greater distance in the earth’s atmosphere before reaching our eyes. In this journey, the shorter wavelengths of lights are spread out and only the longer wavelengths reach our eyes.

Since blue colour has a short wavelength and red colour has a long wavelength, red colour can reach our eyes after the atmospheric scattering of light. Thus, the sun appears to be reddish early in the morning.

13. Why does the sky appear dark instead of blue to an astronaut?

Ans: Since there is no atmosphere in outer space that can scatter the sunlight, the sky appears dark instead of blue to an astronaut.

Since the sunlight is not scattered in space, no scattered light reaches the astronaut’s eyes and the sky appears black to them instead of blue.

## NCERT Solutions for Class 10 Science Chapter 11 - Human Eye and Colourful World

Students who are looking for NCERT Solutions for Class 10 Science Chapter 11 - Human Eye and Colourful World PDF can opt for Upcoming Exams and also You can Find the Solutions of All the Science Chapters below.

NCERT Solutions for Class 10 Science

Also Access

### NCERT Solutions For Class 10 Science Chapter 11 The Human Eye and Colourful World - Free PDF Download

Refer NCERT solutions for class 10 science chapter 11, and score a high percentage in board exams. The step by step solutions provided by top academicians increases the concept of clarity. It supports students to learn quicker. Every single answer of human eye class 10 questions is presented with a well-structured format that will leave no room for any kind of queries or doubts. Students will understand the concepts in connection with chapter 11 by examining solutions.

### NCERT Solutions Class 10 Science Chapter 11- The Human Eye and Colourful World

Human Eye class 10 NCERT solutions emphasize the understanding of the human eye working along with different functions performed by the human eye. Ch 11 covers a thorough explanation of the human eye parts, along with its structural depiction. The students will get to know the concept of the power of accommodation of the human eye.

In ch 11 science class 10 introduces the terms like the least distance of distinct vision and cataract. The students will learn the defects of vision, namely; myopia, hypermetropia, and presbyopia, and their correction. These three defects are explained with the help of well-labeled diagrams. The chapter educates students about the natural phenomena of rainbow formation, atmospheric refraction, the twinkling of stars, and more. At the end of the science chapter The Human Eye and Colourful World, students will get to know the phenomena of scattering of light, the Tyndall Effect, and other natural concepts.

Chapter 11 discusses the different parts of the human eye, along with their characteristics and functions. It includes the cornea, pupil, optic nerve, retina, iris, eye lens, and ciliary muscles. The students can practice human eye diagrams, defects of vision, and their correction with NCERT solutions. Class 10 science chapter 11 lets students know how a rainbow is formed and different applications of scattering of light. Class 10 solutions help students to learn why different colours of light bend through various angles when they pass through a prism.

### Class 10 Science Chapter 11 The Human Eye and Colourful World - Weightage Marks

Chapter Human Eye and Colourful World is based on the structure of the human eye, functioning of each eye part, and methods to treat vision defects. In the annual examination, this unit holds a weightage of 4 marks. The topics included in this unit are:

Ex 11.1 The Human Eye.

Ex 11.2 Defects of Vision and their Correction.

Ex 11.3 Refraction of Light Through a Prism.

Ex 11.4 Dispersion of White Light by a Glass Prism.

Ex 11.4 Atmospheric Refraction, Scattering of Light.

Ex 11.5 Tyndall Effect.

Ex 11.6 Why is the Colour of Sky Blue?

Ex 11.7 Colour of Sun at Sunrise and Sunset.

## Benefits of The Human Eye and Colourful World Chapter 11 NCERT Solutions

NCERT Solutions for Class 10 Chapter 11 help students to appear for the Class 10 Science exam with a better plan by keeping all the vital points in mind. The solutions offer thorough knowledge about the topic in a simple language. Some of the benefits of considering NCERT Solutions for Class 10 Chapter 11 include:

• After analysing NCERT Solutions for Class 10 Chapter 11, students can design their study material in a well-structured way. They get new ideas to shape their study materials.

• Ch 11 Science class 10 NCERT Solutions are comprehensive and prepared by a team of Science experts. Thus, these solutions hold great advantages for the students in their board assessments.

• NCERT Solutions for Class 10 Chapter 11 given here have followed the latest pattern and fulfilled the requirements of the students to prepare well for exams. These solutions can bring a change in methods of preparation.

• The students become able to finish their homework with full confidence once they follow NCERT Solutions.

• The solutions are designed after a lot of research on the particular topic of Chapter 11, and thus help students to build a strong foundation on every topic.

## Practice Questions for Class 10 Science Chapter 11

1. What is the reason beyond the twinkling of stars?

2. Why is the colour of the sky clear blue?

3. Why do stars appear higher than they actually are?

4. Why can we observe rainbows only after the rainfall?

5. Why is there a difference in the colour of the sun observed during sunrise, sunset, and noon? Explain the reason for each.

6. What are Myopia, Hypermetropia, and Presbyopia?

7. What does the power of the accommodation of an eye mean?

8. Why is the danger of “signal lights” red in colour?

9. Why does the sky appear dark to passengers flying at very high altitudes?

10. Why is the sun visible 2 minutes before the actual sunrise and 2 minutes after the actual sunset? Explain it with the reason.

The NCERT Solutions for Class 10 Science Chapter 11 by Vedantu are designed with the main aim of helping students to focus on the important concepts of the chapter. Each and every answer to the questions is explained briefly and in an easy to understand language to help students to improve their conceptual knowledge. The solutions also contain various shortcut techniques which can be used to remember the concepts effectively. Students can refer to the solutions after reading the complete chapter to brush up their understanding.

## FAQs on NCERT Solutions for Class 10 Science Chapter 11

1. Explain Defects of Vision and How to Correct Them.

Myopia, hypermetropia, and presbyopia are three significant defects of vision. Myopia refers to nearsightedness due to which a person can see nearby objects. A person who has myopia cannot see far objects clearly. This defect could be resolved with the help of a concave lens. In hypermetropia, a person cannot see near objects clearly and is corrected by using a convex lens. In presbyopia, a person is difficult to see both nearby and far objects. It is treated with the use of bifocal lenses.

2. What is Atmospheric Refraction Phenomena?

The deflection of light in the atmosphere refers to the phenomena of atmospheric refraction. The change in the direction of propagation of radiation in traversing the atmosphere is known as atmospheric radiation. This refraction is due to light velocity through air. With the increased density, it decreases. It is responsible for various phenomena like delayed sunset, the twinkling of stars, advanced sunrise, and more. The concept of atmospheric refraction is crucial to understand other phenomena occurring in nature.

3. Where can I get the NCERT Solutions for Chapter 11 of Class 10 Science in PDF format?

NCERT Solutions for Chapter 11 of Class 10 Science have been offered by various subject experts through Vedantu app and website. These solutions have been specifically framed in a simple and easy-to-understand language so that the students do not face any difficulty in understanding the concepts being explained in the answers. Solutions for Chapter 11 of Class 10 Science NCERT can be accessed in PDF form free of cost from Vedantu.

4. What are the topics covered in the NCERT Solutions for Chapter 11 of Class 10 Science?

Chapter 11 of Class 10 Science NCERT is called “The Human Eye and Colourful World”. As the name of the chapter suggests, it talks about the working of the human eye in detail. Topics covered in the chapter include different parts of the eye, their functions, and their structural depiction. Concepts like accommodation of the human eye, visionary defects, and their correction are also a part of this chapter. The teaching process also includes various diagrams for various topics.

5. How are NCERT Solutions helpful for Chapter 11 of Class 10 Science?

Grasping all the concepts and being able to use and solve equations appropriately is important to ace Class 10 Science Chapter 11. Hence, referring to NCERT Solutions for Class 10 Science Chapter 11 can provide students with the required help in understanding how to answer questions that can be particularly difficult. These solutions are useful during self-study and students can use them to practice regularly for questions involving equations.

6. What are the important topics in NCERT Solutions for Chapter 11 of Class 10 Science?

Chapter 11: The Human Eye and The Colourful World consists of the following important topics:

• Human Eye Structure

• Scattering of Light

• Defects in Vision and Corrections

• Atmospheric Refractions

• Dispersion

7. How to study Chapter 11 of Class 10 Science?

By following the given below points, one can study Chapter 11 of Class 10 Science.

• Make a list of the subtopics. For instance, if there are five subtopics, and you need one day for each, make sure you book five days for this chapter.

• Make short and easy to read notes.

• Go through NCERT Solutions.

• Go through the diagrams and draw the important ones.

• Revise at regular intervals.


text:
# NAG Library Routine Document

## 1Purpose

x10bb_a1w_f inserts the locations of cb_handle and of companion AD callback into the internal data structure used by the NAG AD Library.

## 2Specification

Fortran Interface
 Subroutine x10bb_a1w_f (
 Integer, Intent (Inout) :: ifail Type (c_ptr), Intent (In) :: cb_handle Type (c_funptr), Intent (In) :: cb_loc
extern "C" {
 void x10bb_a1w_f_ (void *&cb_handle, void *&cb_loc, Integer &ifail)
}
 Declare PtrSafe Sub X10BBF Lib "libname" ( _ cb_handle As LongPtr, cb_loc As LongPtr, ifail As Long)

## 3Description

x10bb_a1w_f inserts the locations of cb_handle and of companion AD callback into the internal data structure used by the NAG AD Library.

None.

## 5Arguments

1:     $\mathbf{cb_handle}$ – Type (c_ptr)Input
On entry: a handle to the callback data object as created by a prior call to x10ba_a1w_f.
2:     $\mathbf{cb_loc}$ – Type (c_funptr)Input
On entry: the location of the user-supplied AD symbolic callback as returned by the intrinsic c_funloc with the callback name the same as the argument.
3:     $\mathbf{ifail}$ – IntegerInput/Output
On entry: ifail must be set to $0$, . If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value  is recommended. If the output of error messages is undesirable, then the value $1$ is recommended. Otherwise, if you are not familiar with this argument, the recommended value is $0$. When the value  is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6Error Indicators and Warnings

If on entry ${\mathbf{ifail}}=0$ or $-1$, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
${\mathbf{ifail}}=1$
On entry, cb_handle does not define a valid handle to a NAG AD callback data object. It has not been initialized or has been corrupted.
${\mathbf{ifail}}=-99$
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

Not applicable.

## 8Parallelism and Performance

x10bb_a1w_f is not threaded in any implementation.


text:
# Computability

Many of my recent posts centre around the concept of computability so I thought I would step back today and give a review of the topic for the uninitiated.  Obviously, there are multiple text books on the topic so I won’t be bringing anything new.  However, I would like to focus on one small aspect of it that is generally glossed over in books.  The main thing to take away from computability for me is that it involves functions of integers. Essentially, a computation is something that maps an integer to another integer.  The Church-Turing thesis states that all forms of computation are equivalent to a Turing machine.  Hence, the lambda calculus, certain cellular automata, and your MacBook have the same computational capabilities as a Turing machine (actually your MacBook is finite so it has less capability but it could be extended arbitrarily to be Turing complete). The thesis cannot be formally proven but it seems to hold.

The fact that computation is about manipulation of integers has profound consequences, the main one being that it cannot deal directly with real numbers.  Or to put it another way, computation is constrained to countable processes.  If anything requires an uncountable number of operations then it is uncomputable. However, uncomputability or undecidability as it is often called, is generally not presented in such a simple way.  In many popular books like Godel, Escher, Bach, the emphasis is on the magical aspect of it.  The reason is that the proof on uncomputability, which is similar to Godel’s proof  of the First Incompleteness Theorem, relies on demonstrating that a certain self-referential function or program cannot exist by use of Cantor’s diagonal slash argument that the reals are uncountable.  In very simple nonrigorous terms, the proof works by considering a list of all possible computable functions $f_i(j)$ on all the integers $j$. This is the same as saying you have a list of all possible Turing machines $i$, of all possible initial states $j$. Now you suppose that one of the functions $f_a(j)$ takes the output of function j given input $j$ and puts a negative sign in front.  So $f_a(j)= -f_j(j)$.  The problem then comes if you suppose that the function acts on itself because then $f_a(a)=-f_a(a)$, which is a contradiction and thus such a computable function $f_a$ cannot exist.

You can see that it is quite a simple argument that shows that there exists one function that is not computable. There is nothing mystical about it.  People seem to get wrapped up in the self-referential part, which at first blush seems to have some magical quasi-religious quality.  However, the basic fact of computation is that there are only a countable number of computable functions but an uncountable number of possible functions.  Although this result is simple, it is incomparably profound.  It puts real limitations on what you can do. For example, whether or not a polynomial equation of integer coefficients has an integer solution (i.e. Hilbert’s tenth problem) is undecidable.  That doesn’t mean you can’t solve particular examples, it just means there does not exist a general algorithm to solve all examples.  The philosophical implications are also extremely deep.  I’ve touched on them in previous posts and will undoubtably return to it in future ones.

One thing you might ask is “don’t we use the real numbers in computations that involve calculus?”  The answer is that one can still talk about real numbers and uncountable infinities in a countable or even finite world.  For example, even if you lived in a finite world you could still discover that real numbers exist and are uncountable.  This is what Cantor did. Essentially, the set of all sets (i.e. power set) of a countably infinite set (e.g. the integers) is uncountable.  A list of countably infinite strings of digits is also uncountable.  You can also assume  the existence of real numbers and ask what happens when you manipulate them.  For example, when you solve a differential equation on the real numbers you are mapping the initial data to some final state.  In most cases, we assume that the initial data is smooth or regular enough that it can be approximated by integers. However, we could still talk about functions of real numbers that cannot be approximated by integers abstractly.  The classic example is the use of the Axiom of Choice, which I will get to in the future.

2011-9-2.  Typos corrected.

## 6 thoughts on “Computability”

1. truetrue says:

“Essentially, the set of all sets (i.e. power set) of a countable set is uncountable.”

Why is the power set uncountable? Isn’t it countable in 2^n steps?

Like

2. The power set of a countably infinite set like the integers is uncountable. I should have made clear that countable implies countably infinite. I’ll correct that.

Thanks.

Like

3. truetrue says:

Got it. Thanks!

Like

4. rgv says:

Maybe a silly question but what is the difference between infinite and uncountable?

Thanks.

Like

5. Hi,

It’s not a silly question but an extremely deep one. Infinities can be countable or uncountable. The set of all natural numbers is countably infinite. Any set that can be paired one-to-one with the natural numbers is also countably infinite. Hence, the integers and rational numbers are also countably infinite. However, the real numbers are not countably infinite. Cantor showed using his diagonal slash argument that if you tried to line up all the real numbers you could always find a real number that is not on the list, The power set of any infinite set is always “bigger” then that set in that it cannot be paired one to one with the elements of that generating set. Hence, there is a hierarchy of bigger and bigger uncountable infinities.

Like

6. […] symbols will appear in the computation and this is equivalent to solving the Halting Problem (see here for a recent post I wrote introducing the concepts of computability).  Hence, knowing if […]

Like


text:
New Titles  |  FAQ  |  Keep Informed  |  Review Cart  |  Contact Us Quick Search (Advanced Search ) Browse by Subject General Interest Logic & Foundations Number Theory Algebra & Algebraic Geometry Discrete Math & Combinatorics Analysis Differential Equations Geometry & Topology Probability & Statistics Applications Mathematical Physics Math Education

Selected Works of Phillip A. Griffiths with Commentary: Variations of Hodge Structures
Edited by: C. Herbert Clemens, University of Utah, Salt Lake City, UT, and David R. Morrison, Duke University, Durham, NC
A co-publication of the AMS and International Press.
 SEARCH THIS BOOK:
Collected Works
2003; 564 pp; hardcover
Volume: 18
ISBN-10: 0-8218-2088-5
ISBN-13: 978-0-8218-2088-9
List Price: US$109 Member Price: US$87.20
Order Code: CWORKS/18.3
This item is also sold as part of the following set: CWORKS/18

Over the last four decades, Phillip Griffiths has been a central figure in mathematics. During this time, he made crucial contributions in several fields, including complex analysis, algebraic geometry, and differential systems. His books and papers are distinguished by a remarkably lucid style that invites the reader to understand not only the subject at hand, but also the connections among seemingly unrelated areas of mathematics. Even today, many of Griffiths' papers are used as a standard source on a subject. Another important feature of Griffiths' writings is that they often bring together classical and modern mathematics.

The four parts of Selected Works--Analytic Geometry, Algebraic Geometry, Variations of Hodge Structures, and Differential Systems--are organized according to the subject matter and are supplemented by Griffiths' brief, but extremely illuminating, personal reflections on the mathematical content and the times in which they were produced.

Griffiths' Selected Works provide the reader with a panoramic view of important and exciting mathematics during the second half of the 20th century.

This book is jointly published by the AMS and the International Press.

Part 3. Variations of Hodge Structures
• Introductory comments to part 3
Periods of integrals
• Periods of integrals on algebraic naifolds, I (Construction and properties of the modular varieties)
• Periods of integrals on algebraic manifolds, II (Local study of the period mapping)
• Periods of integrals on algebraic manifolds III (some global differential-geometric properties of the period mapping)
• On the periods of certain rational integrals I
• On the periods of certain rational integrals: II
• Periods of integrals on algebraic manifolds: Summary of main results and discussion of open problems
Variations of Hodge structures
• Infinitesimal variations of Hodge structure (I)
• Infinitesimal variations of Hodge structure (II): An infinitesimal invariant of Hodge classes
• Infinitesimal variations of Hodge structure (III): Determinantal varieties and the infinitesimal invariant of normal functions
• Acknowledgments
• Selected Titles


text:
Mar 24, 2022

A paper I wrote for my game theory class about a fascinating paradox.

The St. Petersburg paradox is a famous problem in decision theory about a simple game, played as follows:

1. A coin is flipped repeatedly until, on turn n, it lands on heads.

2. The player is awarded $2n. Therefore, in each round the player has a 50% chance of winning$2, a 25% chance of winning $4, a 12.5% chance of winning$8 and so on.

The question is simple: what is a reasonable amount of money to pay to play a round of this game?

Well, a core tenet of decision theory is that any rational person should be willing to pay an amount up to the average payout of the game. However, the St. Petersburg Game is paradoxial: the average payout (expected utility) is infinite.

\begin{aligned} EU &= \sum_{n=1}^{\infty} \frac{1}{2^{n}}\2^n \\ &= \sum_{n=1}^{\infty}1 \\\ &= \\infty\end{aligned}

Of course, no reasonable person expects to win an infinite sum. The probability of large payouts is incredibly low and it’s easy to see that most rounds will award less than $10. On the surface, the answer is simple. It’s irrational to pay a lot to play because the odds of winning a large sum are extremely low. In fancier terms, because the distribution of possible winnings is long-tailed, the mean is a poor measure of central tendency. To illustrate, the following figure and table show the distribution of payouts when one round of the game is simulated for n = 7,900,000 or approximately the global population. While half a dozen people win a billion dollars or more, the overwhelming majority take home only small change. Winnings [$] Number of People
2 3,950,000,000
4 1,980,000,000
8 987,000,000
16 494,000,000
32 247,000,000
64 123,000,000
128 61,700,000
256 30,900,000
512 15,400,000
1,020 7,710,000
2,050 3,860,000
4,100 1,930,000
8,190 965,000
16,400 481,000
32,800 241,000
65,500 120,000
131,000 60,400
262,000 30,100
524,000 15,000
1,050,000 7,540
2,100,000 3,900
4,190,000 1,840
8,390,000 1,000
16,800,000 530
33,600,000 216
67,100,000 123
134,000,000 72
268,000,000 22
537,000,000 26
1,070,000,000 6
2,150,000,000 3
4,290,000,000 3
8,590,000,000 2
17,200,000,000 0

Clearly, expected utility maximization—a core tenet of classical decision theory—fails for this game. However, if the rational price to pay is not infinite, then what is it?

Historical Solutions

These solutions and other variations are again sensible. However, they all may be defeated by increasing the payouts. For example, if the utility function is defined to be U = ln (MV), then the payouts are simply increased to e2n: \begin{aligned} EU &= \sum_{n=1}^{\infty}\left(\frac{1}{2}\right)^n\ln\left(e^{2n}\right) \\ &= \infty \\\end{aligned} Towards a Better Solution One may wonder whether a better strategy may be divised when multiple rounds of the game are played. Clearly, in this scenario a rational player should be willing to pay more per round as they have more chance to get lucky. The figure below plots the average payout per round against the number of rounds played for 5 random simulations. It is interesting to note that while the results vary greatly, in general they seem to follow a linear trendline. The Steinhaus Sequence To understand why, it is necessary to restate the problem. To do so, consider an empty sequence of infinite length. Now fill every other empty space with a 2… $$\begin{bmatrix}{\color{RawSienna} 2} & \_ & {\color{RawSienna} 2} & \_ & {\color{RawSienna} 2} & \_ & {\color{RawSienna} 2} & \_ & {\color{RawSienna} 2} & \_ & {\color{RawSienna} 2} & \_ & {\color{RawSienna} 2}\dots\end{bmatrix}$$ Again, fill every other empty space with a 4… $$\begin{bmatrix}2 & {\color{RawSienna} 4} & 2 & \_ & 2 & {\color{RawSienna} 4} & 2 & \_ & 2 & {\color{RawSienna} 4} & 2 & \_ & 2\dots\end{bmatrix}$$ Once more, now with 8s… $$\begin{bmatrix}2 & 4 & 2 & {\color{RawSienna} 8} & 2 & 4 & 2 & \_ & 2 & 4 & 2 & {\color{RawSienna} 8} & 2\dots\end{bmatrix}$$ And so on… This approach was first proposed by H. Steinhaus, whose sequence represents exactly the expected payouts of the St. Petersburg game. A random draw from elements in the sequence will produce a 2 half the time, a 4 one-quarter of the time, an 8 one-eighth of the time, and so forth. What’s more, values are spaced as they are likely to appear at random. While two large values could in theory appear adjacent to one another, entropy favours an even distribution. Now, the important observation to make is that if this sequence represents expected payouts of the game then it should also represent a fair price to play. For example, if a rational agent has the opportunity to play 3 rounds then he should be willing to pay2+$4+$2=$8, or$2.70 per round to play.

The Table below records these values for numbers of rounds equal to powers of two. At 4 rounds, the fair price is $4. At 8 rounds, it’s$5. At 16, $6. Clearly, at pattern has emerged—the fair price is given by $$\log_2n+2$$, where n is the number of rounds played. This result is verified by Figure 4. While the cumulative average is less than this value when n is not a power of 2, it is always within$1.

Fair per-round prices for the St. Petersburg game.
Number of Rounds Fair Price [$] Fair Price Per Round [$]
4 16 4
8 40 5
16 96 6
32 224 7

Naturally, these findings should be tested experimentally. Figure 5 overlays the simulated mean payouts over n rounds from Figure 3 with the fair price $$\log_2n+2$$ It is remarkably accurate.

Simulations

The following simulations presented in Figure 6 plot the wealth of 1,000 players over 10,000 rounds of the game with per-round fees of (a) $2 and (b)$100.

Clearly, $2 is too low while$100 is too high. However, it is interesting to note the asymmetry in their evolution. At $2, players’ wealth always increases. At$100, however, only the very lucky—represented by horizontal lines on the positive y-axis—can weather the attraction towards debt. However, at the limit, they too will suffer the inevitable s-shaped fall from grace.

By contrast, Figure 7 plots the same simulations with a per-round fee set to $$\log_2n+2\approx\15$$. While players lose money on most rounds, this is offset by the occasional large payout. Consequently, wealth is asymptotically stable—the game is fair.

Conclusion

As with any game of chance, there will never be a completely “correct” solution to the St. Petersburg Paradox. Strategy will always depend on an individual player’s risk tolerance, wealth, and other factors. However, the strategy presented in this paper—that a rational person should be willing to pay \$$$\log_2n+2$$ per-round—is convincing. While the intersection of people with an interest in logical paradoxes and those will unlimited finances may be too limited to test these strategies in the real world, it is at least a fascinating idea to explore.

Source code for all figures and simulations is available at https://github.com/akoen/petersburg. Made using Julia and Gadfly 1.

I would love to hear what you thought of this post. Loved it? Hated it? Want to share your hand-written poem with me via carrier pigeon? That might be challenging—try sending me an email.

You can get updates when I post something new.


text:
## The Annals of Probability

### Airy point process at the liquid-gas boundary

#### Abstract

Domino tilings of the two-periodic Aztec diamond feature all of the three possible types of phases of random tiling models. These phases are determined by the decay of correlations between dominoes and are generally known as solid, liquid and gas. The liquid-solid boundary is easy to define microscopically and is known in many models to be described by the Airy process in the limit of a large random tiling. The liquid-gas boundary has no obvious microscopic description. Using the height function, we define a random measure in the two-periodic Aztec diamond designed to detect the long range correlations visible at the liquid-gas boundary. We prove that this random measure converges to the extended Airy point process. This indicates that, in a sense, the liquid-gas boundary should also be described by the Airy process.

#### Article information

Source
Ann. Probab., Volume 46, Number 5 (2018), 2973-3013.

Dates
Revised: November 2017
First available in Project Euclid: 24 August 2018

https://projecteuclid.org/euclid.aop/1535097644

Digital Object Identifier
doi:10.1214/17-AOP1244

Mathematical Reviews number (MathSciNet)
MR3846843

#### Citation

Beffara, Vincent; Chhita, Sunil; Johansson, Kurt. Airy point process at the liquid-gas boundary. Ann. Probab. 46 (2018), no. 5, 2973--3013. doi:10.1214/17-AOP1244. https://projecteuclid.org/euclid.aop/1535097644

#### References

• [1] Borodin, A. and Ferrari, P. L. (2014). Anisotropic growth of random surfaces in $2+1$ dimensions. Comm. Math. Phys. 325 603–684.
• [2] Borodin, A. and Rains, E. M. (2005). Eynard–Mehta theorem, Schur process, and their Pfaffian analogs. J. Stat. Phys. 121 291–317.
• [3] Boutillier, C. (2007). Pattern densities in non-frozen planar dimer models. Comm. Math. Phys. 271 55–91.
• [4] Boutillier, C., Bouttier, J., Chapuy, G., Corteel, S. and Ramassamy, S. (2017). Dimers on rail yard graphs. Ann. Inst. Henri Poincaré D 4 479–539.
• [5] Bouttier, J., Chapuy, G. and Corteel, S. (2017). From Aztec diamonds to pyramids: Steep tilings. Trans. Amer. Math. Soc. 369 5921–5959.
• [6] Breuer, J. and Duits, M. (2014). The Nevai condition and a local law of large numbers for orthogonal polynomial ensembles. Adv. Math. 265 441–484.
• [7] Bufetov, A. and Gorin, V. (2016). Fluctuations of particle systems determined by Schur generating functions. Available at arXiv:1604.01110.
• [8] Bufetov, A. and Knizel, A. (2016). Asymptotics of random domino tilings of rectangular Aztec diamonds. Available at arXiv:1604.01491.
• [9] Chhita, S. and Johansson, K. (2016). Domino statistics of the two-periodic Aztec diamond. Adv. Math. 294 37–149.
• [10] Chhita, S. and Young, B. (2014). Coupling functions for domino tilings of Aztec diamonds. Adv. Math. 259 173–251.
• [11] Cohn, H., Kenyon, R. and Propp, J. (2001). A variational principle for domino tilings. J. Amer. Math. Soc. 14 297–346.
• [12] Corwin, I. and Hammond, A. (2014). Brownian Gibbs property for Airy line ensembles. Invent. Math. 195 441–508.
• [13] de Tilière, B. (2007). Scaling limit of isoradial dimer models and the case of triangular quadri-tilings. Ann. Inst. Henri Poincaré Probab. Stat. 43 729–750.
• [14] Di Francesco, P. and Soto-Garrido, R. (2014). Arctic curves of the octahedron equation. J. Phys. A 47 1751–8113.
• [15] Dubédat, J. (2015). Dimers and families of Cauchy–Riemann operators I. J. Amer. Math. Soc. 28 1063–1167.
• [16] Dubédat, J. and Gheissari, R. (2015). Asymptotics of height change on toroidal Temperleyan dimer models. J. Stat. Phys. 159 75–100.
• [17] Duits, M. (2013). Gaussian free field in an interlacing particle system with two jump rates. Comm. Pure Appl. Math. 66 600–643.
• [18] Duits, M. (2015). On global fluctuations for non-colliding processes. Available at arXiv:1510.08248.
• [19] Ferrari, P. L. and Spohn, H. (2003). Step fluctuations for a faceted crystal. J. Stat. Phys. 113 1–46.
• [20] Gorin, V. (2017). Bulk universality for random lozenge tilings near straight boundaries and for tensor products. Comm. Math. Phys. 354 317–344.
• [21] Johansson, K. (2003). Discrete polynuclear growth and determinantal processes. Comm. Math. Phys. 242 277–329.
• [22] Johansson, K. (2005). The Arctic circle boundary and the Airy process. Ann. Probab. 33 1–30.
• [23] Johansson, K. (2017). Edge fluctuations of limit shapes. Available at arXiv:1704.06035.
• [24] Kenyon, R. (1997). Local statistics of lattice dimers. Ann. Inst. Henri Poincaré Probab. Stat. 33 591–618.
• [25] Kenyon, R. (2000). Conformal invariance of domino tiling. Ann. Probab. 28 759–795.
• [26] Kenyon, R. (2001). Dominos and the Gaussian free field. Ann. Probab. 29 1128–1137.
• [27] Kenyon, R. (2009). Lectures on dimers. In Statistical Mechanics. IAS/Park City Math. Ser. 16 191–230. Amer. Math. Soc., Providence, RI.
• [28] Kenyon, R. and Okounkov, A. (2007). Limit shapes and the complex Burgers equation. Acta Math. 199 263–302.
• [29] Kenyon, R., Okounkov, A. and Sheffield, S. (2006). Dimers and amoebae. Ann. of Math. (2) 163 1019–1056.
• [30] Nienhuis, B., Hilhorst, H. J. and Blöte, H. W. J. (1984). Triangular SOS models and cubic-crystal shapes. J. Phys. A 17 3559–3581.
• [31] Okounkov, A. and Reshetikhin, N. (2003). Correlation function of Schur process with application to local geometry of a random 3-dimensional Young diagram. J. Amer. Math. Soc. 16 581–603.
• [32] Panova, G. (2015). Lozenge tilings with free boundaries. Lett. Math. Phys. 105 1551–1586.
• [33] Petrov, L. (2014). Asymptotics of random lozenge tilings via Gelfand–Tsetlin schemes. Probab. Theory Related Fields 160 429–487.
• [34] Petrov, L. (2015). Asymptotics of uniformly random lozenge tilings of polygons. Gaussian free field. Ann. Probab. 43 1–43.
• [35] Prähofer, M. and Spohn, H. (2002). Scale invariance of the PNG droplet and the Airy process. J. Stat. Phys. 108 1071–1106.
• [36] Thurston, W. P. (1990). Conway’s tiling groups. Amer. Math. Monthly 97 757–773.


text:
# Detecting worker environments

Hi!

What’s the best approach to use `wrangler dev` and `wrangler preview` and detect the environment?

In both cases I get `ENVIRONMENT is not defined`. Since both command force a KV `preview_id`, there must be a way to determine the mode, no?

Thanks!

1 Like

The docs are a little misleading with the ENVIRONMENT variable… You have to define the ENVIRONMENT var yourself using the vars key like so:

``````vars = { ENVIRONMENT = "production"}

[env.dev]
vars = { ENVIRONMENT = "dev" }
[env.staging]
vars = { ENVIRONMENT = "staging" }
``````

I’ve opened a PR here to update the documentation.

4 Likes

They are indeed a bit confusing. Thanks for the PR!


text:
User Name Remember Me? Password

 » My Math Forum » Home   - Math   - Art
 » Current Poll Am I wrong or Simply Correct? Simply Correct - 65.00% Wrong - 35.00% Total Votes: 40You may not vote on this poll.
 Discussion Last Post Replies Views Forum Problem with square, circle and triangle lua January 22nd, 2018 03:46 PM by skipjack 1 10 Geometry Complicated beam Jimkeller1993 January 22nd, 2018 03:00 PM by studiot 12 254 Real Analysis question on odd numbered composites KenE January 22nd, 2018 01:47 PM by JeffM1 18 723 Math Manipulate data to match given mean and standard... jones123 January 22nd, 2018 03:14 AM by Micrm@ss 3 114 Probability and Statistics Need help solving this work problem TheUrbanChiQ January 22nd, 2018 02:16 AM by AngleWyrm2 3 246 Algebra A weird equation? Java tjmoncur January 22nd, 2018 01:07 AM by weirddave 9 391 Computer Science Given f is one to one, prove $f(A \backslash... John Travolski January 21st, 2018 01:05 PM by SDK 6 127 Real Analysis Probability Estimators question Jaket1 January 21st, 2018 12:04 PM by romsek 2 56 Probability and Statistics principle components analysis Sancho January 21st, 2018 10:29 AM by Sancho 2 76 Real Analysis Extrapolating a partial ordering gelatine1 January 21st, 2018 09:53 AM by Micrm@ss 1 53 Applied Math Completing the square, the easy way rudimt January 21st, 2018 07:43 AM by v8archie 3 135 Pre-Calculus Limit of ordinality Loren January 21st, 2018 12:22 AM by Micrm@ss 4 95 Number Theory Can you solve this question? Please include method moeediftikhar7 January 20th, 2018 05:30 PM by skipjack 2 118 New Users Mathematical induction in Number Theory Alexis87 January 20th, 2018 03:41 PM by SDK 4 116 Abstract Algebra Unclear (to me) problem Denis January 20th, 2018 01:45 PM by romsek 10 211 Algebra Hello Math forum, I need help with situational set... Etron January 20th, 2018 12:29 PM by skipjack 1 75 New Users Solving for mass Benzel January 20th, 2018 11:32 AM by skipjack 1 61 Elementary Math A Proof concerning a negative f(x) Carl James Mesaros January 20th, 2018 10:17 AM by Country Boy 3 159 Calculus Quotient topology aminea95 January 20th, 2018 08:36 AM by SDK 2 140 Topology Modular Arithmetic proof Alexis87 January 20th, 2018 07:56 AM by SDK 4 99 Abstract Algebra How to use a Casio fx-85gt for reverse correlation... nicevans1 January 20th, 2018 04:35 AM by nicevans1 0 63 Probability and Statistics Convergence of Random Sequence John Travolski January 19th, 2018 08:03 PM by John Travolski 2 117 Advanced Statistics Integrals of type x^ncos(ax) or x^nsin(ax)? DecoratorFawn82 January 19th, 2018 12:38 PM by greg1313 7 137 Calculus exponential limit panky January 19th, 2018 12:32 AM by Micrm@ss 1 96 Calculus Equation solution? idontknow January 18th, 2018 08:34 PM by SDK 3 449 Differential Equations determining equations parameter Alirezap January 18th, 2018 08:25 PM by skipjack 4 325 Calculus First order logic radouani January 18th, 2018 08:34 AM by Typhon 1 317 Computer Science Discrete math zanoknight January 18th, 2018 08:27 AM by Typhon 2 224 Computer Science HOW TO DO INTEGRATION OF SIN c++ integration January 18th, 2018 08:19 AM by Typhon 8 186 Computer Science Sylow's Theorem Lalitha183 January 18th, 2018 03:51 AM by cjem 4 159 Abstract Algebra Exponential identity Loren January 17th, 2018 01:47 PM by v8archie 16 307 Algebra Problem with primes lua January 17th, 2018 10:17 AM by lua 4 180 Number Theory Order of an element in a Group Lalitha183 January 17th, 2018 10:09 AM by johng40 3 150 Abstract Algebra Graphical method versus Transition State Audiana January 17th, 2018 04:04 AM by Audiana 0 61 Chemistry Use a number line to order the numbers from least to... Help123 January 16th, 2018 02:20 PM by mathman 1 95 Algebra Antiderivative Leonardox January 16th, 2018 12:22 PM by Country Boy 14 453 Calculus Simple(st) Proof of Fermat's Last Theorem. Mariga January 16th, 2018 10:39 AM by Denis 206 8,789 Number Theory Proving that$Gal(L/F)\overset{∼}{=}N_G(H)/H\$ mona123 January 16th, 2018 02:12 AM by mona123 0 149 Abstract Algebra I developed a method of integration and want some... Typhon January 15th, 2018 09:05 PM by Typhon 2 190 Calculus Thick and thin walled cylinders aaronmooy47 January 15th, 2018 09:57 AM by aaronmooy47 8 220 Real Analysis Calc Limits dnice January 15th, 2018 08:05 AM by dnice 5 118 Pre-Calculus Probablity - round table policer January 15th, 2018 05:08 AM by Denis 8 190 Probability and Statistics Introduction Justinetea January 15th, 2018 01:09 AM by Joppy 3 195 New Users Another Least Square question.. zollen January 14th, 2018 11:21 AM by zollen 0 144 Linear Algebra relation between order of polynomial fit and range of... chr January 14th, 2018 10:32 AM by chr 4 150 Algebra Least Squares Problem zollen January 14th, 2018 07:23 AM by zollen 3 181 Linear Algebra Proving that P, Q, and R lie on the same straight line Hussain2629 January 13th, 2018 11:09 PM by Hussain2629 6 221 Geometry (Compressive - tensile) stresses Loren January 13th, 2018 04:09 PM by studiot 6 241 Physics slope of a graph Audiana January 13th, 2018 03:11 PM by Country Boy 10 395 Pre-Calculus langmuir equation for the reactions Audiana January 13th, 2018 02:21 AM by greg1313 1 255 Chemistry

 Contact - Home - Forums - Cryptocurrency Forum - Top


text:
# Question df236

Nov 22, 2015

$\text{27 g}$

#### Explanation:

The trick here is to look out for the phase change underwent by the ice sample.

More specifically, the ice will absorb heat from the hot water to go from solid at ${0}^{\circ} \text{C}$ to liquid at ${0}^{\circ} \text{C}$, then the liquid water at ${0}^{\circ} \text{C}$ will absorb heat to go to liquid at ${15}^{\circ} \text{C}$, the final temperature of the mixture.

All this heat will come from the hot water sample, hence the drop in temperature between the initial temperature of ${55}^{\circ} \text{C}$ and the final temperature of ${15}^{\circ} \text{C}$.

Mathematically, this heat exchange can be expressed like this

$\textcolor{b l u e}{{q}_{\text{ice" + q_"cold water" = -q_"hot water}}}$

Here the minus sign is used because heat lost carries a negative sign.

The two equations that you will use are

$\textcolor{b l u e}{q = m \cdot c \cdot \Delta T} \text{ }$, where

$q$ - heat absorbed
$m$ - the mass of the sample
$c$ - the specific heat of water
$\Delta T$ - the change in temperature, defined as final temperature minus initial temperature

and

color(blue)(q = n * DeltaH_"fus")" ", where

$q$ - heat absorbed
$n$ - the number of moles of water
$\Delta {H}_{\text{fus}}$ - the molar heat of fusion of water

So, your equation will look like this

$n \cdot \Delta {H}_{\text{fus" + m * c_"water" * DeltaH_"cold" = - m_"water" * c_"water" * DeltaH_"cold}}$

Since $n$ represents moles of water that were initially present as ice, you can rewrite this term by using water's molar mass and the mass of ice, $\textcolor{b l u e}{m}$

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

The above equation thus becomes

$\frac{\textcolor{b l u e}{m}}{18.015} \cdot \Delta {H}_{\text{fus" + color(blue)(m) * 18.015 * c_"water" * DeltaT_"cold" = - m_"water" * c_"water" * DeltaT_"hot}}$

Plug in your values and solve for $\textcolor{b l u e}{m}$, the mass of ice

$\frac{\textcolor{b l u e}{m}}{18.015} \textcolor{red}{\cancel{\textcolor{b l a c k}{\text{moles"))) * 6.01"kJ"/color(red)(cancel(color(black)("moles"))) + color(blue)(m) * 4.18"J"/(color(red)(cancel(color(black)("g"))) * color(red)(cancel(color(black)(""^@"C")))) * (15 - 0)color(red)(cancel(color(black)(""^@"C"))) = - 64.3color(red)(cancel(color(black)("g"))) * 4.18"J"/(color(red)(cancel(color(black)("g"))) * color(red)(cancel(color(black)(""^@"C")))) * (15 - 55)color(red)(cancel(color(black)(""^@"C}}}}$

Do not forget that you're dealing with kilojoules and joules, so convert the kilojoules to joules to keep track of the proper units

$\textcolor{b l u e}{m} \cdot 333.6 \textcolor{red}{\cancel{\textcolor{b l a c k}{\text{J"))) + color(blue)(m) * 62.7color(red)(cancel(color(black)("J"))) = 10751color(red)(cancel(color(black)("J}}}}$

This is equivalent to

$\textcolor{b l u e}{m} \cdot 396.3 = 10751 \implies \textcolor{b l u e}{m} = \frac{10751}{396.3} = \text{27.128 g}$

I'll leave the value rounded to two sig figs

m_"ice" = color(green)("27 g")#


text:
vlhc:mc

# MC simulations for VLHC

Monte Carlo simulation files with 100 TeV collision events can be downloaded from the HepSim repository. You download, view and process Monte Carlo files as explained here. Also, look at the HepSim wiki.

Some fully reconstructed files using LCD are here http://atlaswww.hep.anl.gov/asc/vlhc/data/


text:
# Quark Matter 2017

Feb 5 – 11, 2017
Hyatt Regency Chicago
America/Chicago timezone

## Bottomonia results from the LHC Run 1 and 2 with CMS

Feb 7, 2017, 4:50 PM
20m
Regency C

Oral Quarkonia

### Speaker

Chad Steven Flores (University of California Davis (US))

### Description

Bottomonia are important probes of the quark-gluon plasma since they are produced at early times and propagate through the medium, mapping its evolution. They are also considered to be cleaner probes than charmonia due to the lack of regeneration even at the LHC energies. In Run 1 at the LHC, CMS was able to explore multiple measurements of the Y(nS) states in pp and PbPb collisions, down to $p_{T}$ = 0. In PbPb and pp, the production cross sections for all three Y(nS) states were measured at $\sqrt{s_{NN}}$ = 2.76 TeVwith the exception of the Y(3S) state, which was not observed in PbPb collisions. The suppression of the Y(1S) state was seen to depend on centrality, but not significantly on transverse momentum or rapidity. In Run 2, we have now measured the ground state to excited state ratios of Bottomonia in PbPb and pp collisions at $\sqrt{s_{NN}}$ = 5.02 TeV. The Y(2S)/Y(1S) ratiois found to be below 1 over the full centrality range and a weak dependence is found as a function of dimuon kinematics. For the Y(3S) state, an upper limit has been obtained as a function of centrality where a Y(3S)/Y(1S) ratio compatible with 0 is observed over the full centrality range. In this talk, we will present the final CMS results on bottomonium production from Run 1, together with new Run 2 results from the high statistics PbPb data at $\sqrt{s_{NN}}$ = 5.02 TeV collected in 2015.

Collaboration CMS Quarkonia

### Primary author

Chad Steven Flores (University of California Davis (US))


text:
# Conflict with cite and changes

For a scientific publication, I am writing a modified version of my article which takes in account the comments of my reviewers. I need to identify which modification is due to which reviewer, so I use the changes package. Obviously, I have references in my article, so I use the cite package.

PDFLaTeX (TexLive 2014) gives me errors when I use the cite command within the deleted or replaced commands of the changes package. Here is a minimal working example:

\documentclass{article}

\usepackage{cite}
\usepackage{changes}

\begin{document}

As previously observed \deleted{in \cite{someref}, there is no banana here.}

\begin{thebibliography}{9}
\bibitem{someref}
Some ref here.
\end{thebibliography}

\end{document}

I get the following errors:

! Extra }, or forgotten \endgroup.
\UL@stop ...alty \ifnum \lastkern =\thr@@ \egroup
\egroup \ifdim \wd \UL@box...
l.8 ...n \cite{someref}, there is no banana here.}

! Extra }, or forgotten \endgroup.
\UL@stop ...num \lastkern =\thr@@ \egroup \egroup
\ifdim \wd \UL@box =\z@ \e...
l.8 ...n \cite{someref}, there is no banana here.}

! Missing } inserted.
<inserted text>
}
l.8 ...n \cite{someref}, there is no banana here.}

! Missing } inserted.
<inserted text>
}
l.8 ...n \cite{someref}, there is no banana here.}

If I remove the cite packages, everything is back to normal. Unfortunately, I need this package.

The question is really close to this unanswered one. What should I do?

• Not at pc, but does \protect\cite help? Note that the cite package us not required to use \cite, that command is already in the core, so you can probably do without it. – daleif Jul 10 '17 at 17:07
• Now I tested it, \protect is not enough. But removing the cite package is enough. As mentioned, the cite package is not required to use the \cite command – daleif Jul 11 '17 at 7:01
• Hmm, it does seem to work if you use \noexpand\cite to keep \deleted from expanding too much too early. – daleif Jul 11 '17 at 9:34
• I don't think that many people uses the package. The main issue is that changes uses ulem to make the strikethrough part. It is well known that this does not always work. Try if \mbox{\cite{...}} works. – daleif Jul 11 '17 at 12:44
• The ulem manual explicitly mentions \mbox{\cite{....}} as a work around. – daleif Jul 11 '17 at 12:55

As daleif pointed out in comments, the problem is due to the ulem package used to strike deleted changes in the changes package. It is known to behave weirdly for some commends, among them cite.
As indicated in the documentation, you have to wrap your cite in a mbox like this:
As previously observed \deleted{in \mbox{\cite{someref}}, there is no banana here.}


text:
Maximize combinatorial sum for boolean function

I am trying to maximize the function $$S(f)=\sum_{j=0}^{n-\frac{n-1}{t}}(-1)^j{n-\frac{n-1}{t}\choose{j}}\sum_{i=0}^{\frac{n-1}{t}}(-1)^{f(i-j)}(t-1)^i{\frac{n-1}{t}\choose{i}}$$ for a function $f:\mathbb{Z}\rightarrow\{0,1\}$. So, I want to find a sequence of signs + and -, which maximizes S(f). One can easily compute this expression for $f(x)=0$ and for $f(x)=1$. In the first case one will obtain $0$, in the second - $$(-1)^{\frac{n-1}{t}}(t-2)^{\frac{n-1}{t}}2^{n-\frac{n-1}{t}}.$$ One can also consider $n\gg t$.

Any ideas to find the best function $f$?

• $n$ and $t$ given, $t > 1$? $(n-1)/t$ an integer? How did this problem arise? – Robert Israel Jul 23 '14 at 19:36
• Yes, n,t are integers, $n>t$, $t>1$. – user56357 Jul 24 '14 at 3:53
• You mean, $f(x)=1$, and not $f(x)=x$ i suppose. (I edited the question) – Per Alexandersson Aug 22 '14 at 20:24

Let $m = (n-1)/t$. For convenience, I'll assume this is an integer.
For fixed $k$, the contribution from terms with $i-j=k$ is $$(-1)^{f(k)} \sum_{j=\max(0,-k)}^{\min(n-m,m-k)} (-1)^j {{n-m}\choose j} {m \choose {j+k}} (t-1)^{j+k}$$ So you choose $f(k)$ to make that contribution $\ge 0$.
• Actually, this expression can be reformulated with help of q-Krawtchouk polynomials and it was a staring point. Unfortunately, nobody knows the way to predict, whether a given Krawtchouk polynomial is greater than $0$. – user56357 Jul 24 '14 at 4:52