text:
# All Questions

40 views

### Translating syntax of a pure function

I have a matrix in complex exponential form. I want to factor out the complex exponential form and then express the inside in the a+i*b form. For example: \begin{bmatrix} e^{i \frac{\pi}{4}} ...
53 views

### RunProcess not working on my Windows system

System: Windows 10 professional. Mathematica Version: 10.3.0 English. RunProcess doesn't work in my computer. I tried different examples given in the ...
82 views

### Solving diffusion-like PDE for f(r,t)

I am trying to solve a partial differential equation like the following: where Sigma is mass density as a function of radial distance r and time t. I am expecting a diffusive behavior, and the ...
15 views

### Finding the positions DateList dates in a range in large data set

There are similar questions to this like list search but this question is focused on finding at subset of dates in DateList format within a range of specified dates ...
26 views

### Duration of each note $\pm \epsilon$

Apologies if this has been asked before, but I can't seem to find a solution. I have a little track - eg: ...
35 views

### Reducing the size of exported .eps files to the minimum necessary

Running version 10.3 on my Power Mac with 22 Gbytes of memory I can create and export an .eps or .pdf graphics such as, ...
21 views

### Find all solutions which satisfy the given conditions

Let $$m=9n^3+30n^2-9n$$ where $n \in \mathbb{Q^{+}}$ and $m \in \mathbb{Z}$ . Find all solutions which satisfy the given conditions. So I've tried to solve this manually and I was ...
78 views

### Orderless and Sequence

I just ran into the following subtlety. Let us consider a function f with attribute Orderless. ...
95 views

257 views

### Changing scroll rate for page down key? [on hold]

I have a presentation remote that allows me to advance Mathematica slides in the SlideShow environment. The control sends a page down key. Some of my slides ...
47 views

### Getting axes range from plot (of the plot) [duplicate]

Related to this question in a way. After making a plot, I'd like to get the plot range (not the range of the function, but the range chosen for plotting which usually leaves some buffer room). I've ...
407 views

Ten years ago I bought a book by Tom Wickham-Jones, Mathematica Graphics: Techniques and Applications. I read parts of it but then I forgot its existance. In recent years I read the nice book of ...
144 views

### intersecting cylinders

I try to replicate the two figures of two intersecting cylinders from here. I tried ...
192 views

### Coordinate system transformation problem (about Euler angle)

This question comes from the work that constructing the general cylinder by the NURBS. I have implemented the point-set $P_1,P_2,\cdots,P_n$ that in the $O-xyz$ plane, now I want to implement the ...
32 views

### How to find x intercept using two functions in NDSolve?

I have functions for x[t] and y[t] in NDsolve and I want to find where the graph crosses the ...
41 views

### How to add two probability density function plot in mathematica [on hold]

The mean and standard deviation of plot 1 is [.38404, .03867] and of plot 2 is [.38404, .542]. With the mean and std deviation I can plot PDF(Normal distribution) using ...
84k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
53 views

### ListPlot of imginary part

Assuming I have a list like: {{1, 1. - 0.0169212 I}, {2, 0.99611 + 0.0326189 I}, {3,1.02048 + 0.0945609 I}, {4, 1.02722 + 0.138977 I}} When I try now ...
31 views

### For “ListPlot3D” ,How to make a color plot, if the f(x,y) range only from very small amount [on hold]

I have plotted with List3d plot using the following command ...
44 views

### Kernel crash when evaluating NDSolveValue

I had a code that was working fine and I tried to add an extra few lines to find the solution of the same equation with different conditions. The original NDSolveValue solutions work fine but when it ...
35 views

### Y-axis Tick labels are all identical [duplicate]

For Plot[x^12 - x^9 + x^4 + 1, {x, -.001, .001}] Details on Y-axis seem to be wrong.I am using V 9.0.1.0 .Bug?
425 views

### Random polyhedra walk

I would like to recreate ssch's random polyhedra random walk, which he posted in the chat. For convenience here it is again: This is my best attempt so far: You can download the notebook with ...
34 views

### How to delete certain words from a word cloud in mathematica?

I generated word clouds from a text file in Mathematica. I was able to remove words with 5 or less characters from the cloud. ...
32 views

### Avoiding Smoothing in ListSurfacePlot3D

I'm loading a dataset {x,y,z,v} from a text file. It is about a triangulated surface and then I am using ListSurfacePlot3D to plot it. However, ListSurfacePlot3D is ...
27 views

### Maximum Value of an Interpolating Function [on hold]

my code below does not output the correct maximum value. ...
95 views

### SubsetQ[] without ignoring duplicates

How could one create a code that checks whether a set is a subset of another, but not ignoring the duplicates? For example, $\{1,1,1\}$ would be a subset of $\{1,1,1,1\}$, but not vice versa. ...
570 views

### Magnifying Glass on a Plot

Although there is a trick in TEX magnifying glass but I want to know is there any function to magnifying glass on a plot with Mathematica? For example for a function as ...
38 views

### Wrong root when using numerical values

I have the following inequality: $$\sqrt{\frac{a}{2x}}+ \frac{b}{1-\frac{a}{a+\sqrt{a(2bx + a)}}} + \frac{a}{2x\frac{a}{a+\sqrt{a(2bx + a)}}\left(1-\frac{a}{a+\sqrt{a(2bx + a)}}\right)} < f$$ on ...
302 views

### How to code the following in Mathematica

How do I get the following into Mathematica, solving for a: $$0.7 = 1 - \frac{2}{a} \times [ \frac{1}{a} \int_0^a \frac{x}{\exp(x)-1} dx + \frac{a}{6} - 1]$$
352 views

### What exactly is Implies? Is it a logical test?

I ran the following to simplify my logical test (expecting something in terms of And and Or ...) ...
52 views

### Why won't DiscretizeRegion work with a custom distance function? [on hold]

I am trying (in 10.0) to create a region from a list of data points. I have created myDistance to use as the boolean test for whether or not a point should be included in the region ...
142 views

### Why am I getting different answers for an integral depending on method?

I'm trying to carry out an integral and I'm finding different answers depending on which method I choose to integrate with. I assume this has something to do with divergent pieces but I don't ...
32 views

### Trouble solving system of nonlinear equations with piecewise

Here is my code so far ...

15 30 50 per page


text:
# Punctured disks and punctured curves and cohomology, oh my! (Part I: the proper curve case)

This is the first in a series of posts whose goal is to compute the cohomology of the (several times) punctured closed $p$-adic disk $\mathbb{B}_{\mathbb{C}_p}-\{p_1,\ldots,p_m\}$ as well as the cohomology of smooth (and some non-smooth) algebraic curves.

format: plain


text:
Take FREE!! Online AMCAT Mock Test to Crack Wipro NLTH, Capgemini, etc.
Get Off-Campus Placement Jobs Info !!!
Practice Given Here Wipro NLTH Practice Q&A

# Time and Work Questions and Answers

Home > Quantitative Aptitude > Time and Work > General Questions
NA
SHSTTON
506
Solv. Corr.
168
Solv. In. Corr.
674
Attempted
0 M:20 S
Avg. Time

1 / 90

Choose the correct option.

A can do a work in 10 days and B can do the same work in 15 days. So how many days they will take to finish the same work ?

A5 days

B7 days

C9 days

D6 days

Explanation:

First find the 1 day work of both (A & B)
A 1 day's work = 1/10
and
B 1 day's work = 1/15

So (A + B) 1 day's work = (1/10+1/15)
= (3/30+2/30) = 5/30 = 1/6

So Both (A & B) together can finish work in 6 days

Workspace

NA
SHSTTON
74
Solv. Corr.
132
Solv. In. Corr.
206
Attempted
2 M:21 S
Avg. Time

2 / 90

Choose the correct option.

A and B together can do a piece of work in 12 days, which B and C together can do in 16 days. After A has been working at it for 5 days and B for 7 days, C finishes it in 13 days. In how many days C alone will do the work ?

A16

B24

C36

D48

Explanation:

(A and B) 1 day work = 1/12 -----(1)
(B and C) 1 day work = 1/16 -----(2)

Given A's 5 days' work + B's 7 days' work + C's 13 days' work = 1
simplify the above ..
=> (A + B)'s 5 days' work + (B + C)'s 2 days' work + C's 11 days' work = 1

Put the values from equation (1) & (2)
=> (5*1/12)+(2*1/16) + C's 11 days' work = 1

=> C's 11 days' work = (1-5/12+2/16)=11/24

=> C's 1 day's work = (11/24?1/11)=1/24

So C alone can finish the work = 24 days.

Workspace

NA
SHSTTON
80
Solv. Corr.
100
Solv. In. Corr.
180
Attempted
2 M:47 S
Avg. Time

3 / 90

Choose the correct option.

A and B can do a piece of work in 45 days and 40 days respectively. They began to do the work together but A leaves after some days and then B completed the remaining work in 23 days. The number of days after which A left the work was :

A6

B8

C9

D12

Explanation:

A's 1 day work = 1/45
B's 1 day work = 1/40

so (A + B)'s 1 day's work = (1/45+1/40)=17/360

Work done by B in 23 days = (140?23)=2340
Remaining work =(1-23/40)=17/40

Now, 17/360 work was done by (A + B) = 1 day.

17/40 part of work was done by (A + B) = (1?360/17?17/40) = 9 days.

A left after 9 days.

Workspace

NA
SHSTTON
94
Solv. Corr.
65
Solv. In. Corr.
159
Attempted
2 M:21 S
Avg. Time

4 / 90

Choose the correct option.

A, B and C together earn Rs. 300 per day, while A and C together earn Rs. 188 and B and C together earn Rs. 152. The daily earning of C is :

ARs. 40

BRs. 68

CRs. 112

DRs. 150

Explanation:

B's daily earning = Rs. (300 - 188) = Rs. 112.

A's daily earning = Rs. (300 - 152) = Rs. 148.

C's daily earning = Rs. [300 - (112 + 148)] = Rs. 40.

Workspace

NA
SHSTTON
108
Solv. Corr.
62
Solv. In. Corr.
170
Attempted
7 M:27 S
Avg. Time

5 / 90

Choose the correct option.

Kim can do a work in 3 days while David can do the same work in 2 days. Both of them finish the work together and get Rs. 150. What is the share of Kim ?

ARs. 30

BRs. 60

CRs. 70

DRs. 75

Explanation:

Kim 1 day work = 1/3
David 1 day work = 1/2
Kim's 1 day's work : David's 1 day's work=(1/3)/(1/2) = 2 : 3.

Kim's share = Rs. (2/5?150)=Rs. 60

Workspace

NA
SHSTTON
72
Solv. Corr.
140
Solv. In. Corr.
212
Attempted
2 M:5 S
Avg. Time

6 / 90

Choose the correct option.

A can do a piece of work in 14 days which B can do in 21 days. They begin together but 3 days before the completion of the work, A leaves off. The total number of days to complete the work is:

A6 3/5

B8 1/2

C10 1/5

D13 1/2

Explanation:

A's 1 day work = $$\frac{1}{14}$$
B' 1 day work = $$\frac{1}{21}$$

A left 3 day before the completion of work.
B's 3 days' work = $$\frac{1}{21} \times 3 = \frac{1}{7}$$
Remaining work = $$1 \times \frac{1}{7} = \frac{6}{7}$$

(A + B)'s 1 day's work = $$\left(\frac{1}{14} + \frac{1}{21}\right) = \frac{5}{42}$$

Now, $$\frac{5}{42}$$ work is done by A and B = 1 day.
or
whole work done by A&B = $$\frac{42}{5}$$
$$\frac{6}{7}$$ part of work done by A and B = $$\frac{42}{5} \times \frac{6}{7} = \frac{36}{5}$$ days.

Hence, total time taken = (3+36/5)days = $$10\frac{1}{5}$$ days.

Workspace

NA
SHSTTON
67
Solv. Corr.
68
Solv. In. Corr.
135
Attempted
7 M:52 S
Avg. Time

7 / 90

Choose the correct option.

A, B and C can complete a work separately in 24, 36 and 48 days respectively. They started together but C left after 4 days of start and A left 3 days before the completion of the work. In how many days will the work be completed ?

A15 days

B22 days

C25 days

D35 days

Explanation:

(A + B + C)'s 1 day's work = (1/24+1/36+1/48)=13/144

Work done by (A + B + C) in 4 days = 4*13/144=13/36

Work done by B in 3 days = 1/36?3=1/12
Left work = [1?(13/36+1/12)]=5/9

(A + B)'s 1 day's work = (1/24+1/36)=5/72

5/72 part of work is done by A and B = 1 day
5/9 work done by A & B = (72/5?5/9) = 8 days.

So, total time taken = (4 + 3 + 8) days = 15 days.

Workspace

NA
SHSTTON
41
Solv. Corr.
72
Solv. In. Corr.
113
Attempted
3 M:25 S
Avg. Time

8 / 90

Choose the correct option.

A, B and C are employed to do a piece of work for Rs. 529. A and B together are supposed to do 19/23 of the work and B and C together 8/23
of the work. What amount should A be paid ?

ARs. 315

BRs. 345

CRs. 355

DRs. 375

Explanation:

B and C together done = 8/23 part
So Work done by A = (1?8/23)=15/23 and
work done by C = (1-19/23) = 4/23, so work done by B = 4/23

A : B : C = 15/23:4/23:4/23 = 15:4:4

So, A's share = Rs. (15/23?529) = Rs. 345.

Workspace

NA
SHSTTON
51
Solv. Corr.
60
Solv. In. Corr.
111
Attempted
1 M:14 S
Avg. Time

9 / 90

Choose the correct option.

A tyre has two punctures. The first puncture alone would have made the tyre flat in 9 minutes and the second alone would have done it in 6 minutes. If air leaks out at a constant rate, how long does it take both the punctures together to make it flat ?

A4 1/4

B5/18

C3 3/5

D3/5

Explanation:

1 minute's Work by both punctures = (1/9+1/6) = (2/18+3/18) = 5/18
So both punctures can make tyre flat = 18/5 = 3 3/5

Workspace

NA
SHSTTON
72
Solv. Corr.
35
Solv. In. Corr.
107
Attempted
3 M:13 S
Avg. Time

10 / 90

Choose the correct option.

A man can do a job in 15 days. His father takes 20 days and his son finishes it in 25 days. How long will they take to complete the job if they all work together?

AApproximately 6.4 days

BExactly 6 days

CLess than 6 days

DMore than 10 days

Explanation:

Find the 1 day work for all three
1 day's work for all three = (1/15 + 1/20 + 1/25)
= (20/300 + 15/300 + 12/300) = 47/300
So all together can do the work in 300/47 days. => 6.4 days.

Workspace

Time and work are one of the most important topics of quantitative aptitude written exams. You can browse this page to find the time and work quantitative aptitude questions and start practicing right now.

To simplify the process, we have introduced the test with user-friendly options including workspace, discussion forum, and view the answer section. Just answer these time and work quantitative aptitude questions to increase your chances in clearing this important round with flying colors! We are always collecting a maximum number of questions from the recruiters and other candidates to help the fresher and experienced candidate community crack the interviews and work in their dream company.

## Quantitative Aptitude Time and Work Questions and Answers pdf

At Quantitative Aptitude topic Time and Work, you will get multiple online quiz difficulty wise, which will have a total of 6 quizzes, categorized as easy, medium, and moderate level. While preparing for any Time and Work, take all the list quiz and check your preparation level for that topic. Each quiz have 10 different question, which needs to be answered in 20 min., all the listed quiz here is free, however, you will get only one chance for each quiz to attempt(Take Quiz seriously), so it is always recommended to take one quiz in each section before you start solving Time and Work MCQs practice question, and one after solving all the question of the respective level, you can refer back your Time and Work quiz result any time or you can download it as pdf for reference.

## Quantitative Aptitude Time and Work Customize Online Mock Test

This is own type of mock test, where At this Quantitative Aptitude Time and Work MCQs mock test section, you will able to attempt only the questions related to Time and Work, in that question will be a different level, important, and all the questions will be part of some of the mock tests across Q4interview FREE Mock test. You need to choose the topic as Time and Work, and click on Double click to generate your customize mock test. While attempting the mock test you need to choose any of the one options out of given option. It is recommended to go through the direction given along with each question, as these questions will be randomly and so that same direction will not be applicable across the entire test. Once you submit your mock test, the result will be generated for Time and Work Customize mock test, where your performance point points will be highlighted. Q4interview analysis every single point which helps you to improve your topic understanding and help you to know your type of mistakes and way to improve Time and Work questions, by providing the same type of practice questions from practice exercise. The best part of this Time and Work, all these mock tests listed here are free and you can take as Many time, as many you want. When you continue to give Time and Work Customize Online Mock Test here regularly, then you will understand how much you have developed your accuracy on a topic, after that you will be able to decide how much attention you need to focus on. Your continued practice will increase your confidence, speed and thinking ability intensely, the Time and Work Customize topic on which you will practice more will beneficial for you in future during campus placement.

## Quantitative Aptitude Time and Work Quiz Online Test

The details of the Quantitative Aptitude Time and Work quiz are as follows. There are 10 questions for you. You have to answer them in 20 minutes. Within 20 minutes you have to see the errors in the sentences given as a question. Four options are also given to you, and you have to choose your opinion. You must be confident in your answer that the choices are difficult. Therefore, below we provide you with some information about Quantitative Aptitude Time and Work that you see and keep them in mind while answering questions.

## Quantitative Aptitude Time and Work MCQs Practice Questions with Answer

On this Time and Work section of page you will find the easiest quickest ways to solve a question, formulas, shortcuts and tips and tricks to solve various easiest methods to solve Time and Work Question Quickly. It contains all the Quantitative Aptitude topic Time and Work questions which are common in any of the preliminary exams of any company. The solution is provided along with the questions. The practice of these questions is a must as they are easy as well as scoring and asked in all the exams They will confirm the selection if all the questions attempted wisely with little practice. It is recommanded to Take Mock test based on Quantitative Aptitude topic and Time and Work topic based quiz.

## Quantitative Aptitude Time and Work solved examples question

You can get here fully solved Time and Work examples with a detailed answer and description. You can solve Time and Work problems with solutions, the questions by companies wise by filtering the questions, additionally, you can check what type of questions are being asked in IT companies Written Round from Time and Work. Time and Work became one of the most important sections in the entire competitive exams, Companies Campus, and entrance online test. Go through Time and Work Examples, Time and Work sample questions. You can Evaluate your level of preparation in Time and Work by Taking the Q4Interivew Time and Work Online Mock Test based on most important questions. All the Time and Work practice questions given here along with answers and explanations are absolutely free, you can take any number of time any mock Test.

## Why Quantitative Aptitude Time and Work?

In this practice section, you can practice Quantitative Aptitude Questions based on "Time and Work" and improve your skills in order to face the interview, competitive examination, IT companies Written exam, and various other entrance tests (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.

## Where can I get Quantitative Aptitude Time and Work questions and answers with explanation?

Q4Interview provides you lots of fully solved Quantitative Aptitude (Time and Work) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. You can download Quantitative Aptitude Time and Work quiz questions with answers as PDF files and eBooks.

## Where can I get Quantitative Aptitude Time and Work Interview Questions and Answers (objective type, multiple-choice, quiz, solved examples)?

Here you can find objective type Quantitative Aptitude Time and Work questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.


text:
Checking database value script

I made a PHP script to check value before update. This script is working fine. But, I wonder how to simplify this. If there are hundreds of columns to be checked then it's hundreds of PHP lines.

This is used for saving a log file for update. So, if data is updated then it stores a log in a table.

public function edit_project_master(){
$no_pro = 'PRJ-2017-501'; //$na_pro     = $this->input->post('na_pro'); //value for edit$ja_pro     = $this->input->post('i_metode'); //value for edit$check_pro  = $this->MProject->get_det_pro($no_pro); //get data form table

//checking script
foreach($check_pro as$res_check_pro){

if($na_pro !=$res_check_pro['NAMA_PROJECT']){  //IF VALUE DIFFERENT
$col_name; foreach($res_check_pro as $key_pro =>$val_pro){
if($res_check_pro['NAMA_PROJECT'] ==$val_pro){
$col_name =$key_pro;            //GET COLUMN NAME
}
}

$data['ACTIVITY'] = "UPDATE";$data['OLD_VALUE']      = $res_check_pro['NAMA_PROJECT'];$data['NEW_VALUE']      = $na_pro;$data['COL_AFFECTED']   = $col_name;$data['TABLE_AFFECTED'] = "PM_REQUIREMENT_PROJECT";  //How to get table name automatically??
$data['ANNOTATION'] = NULL;$data['EXECUTOR']       = $this->session->userdata('nip');$data['CHANGED_ON']     = date("Y-m-d H:i:s");
$data['CHANGED_BY'] =$_SERVER['REMOTE_ADDR'];
$data['STATUS'] = 1;$this->MProject->ins_system_log($data); } if($ja_pro != $res_check_pro['JADWAL_PROJECT']){$col_name;

foreach($res_check_pro as$key_pro => $val_pro){ if($res_check_pro['JADWAL_PROJECT'] == $val_pro){$col_name = $key_pro; } }$data['ACTIVITY']       = "UPDATE";
$data['OLD_VALUE'] =$res_check_pro['JADWAL_PROJECT'];
$data['NEW_VALUE'] =$na_pro;
$data['COL_AFFECTED'] =$col_name;
$data['TABLE_AFFECTED'] = "PM_REQUIREMENT_PROJECT"; //How to get table name automatically??$data['ANNOTATION']     = NULL;
$data['EXECUTOR'] =$this->session->userdata('nip');
$data['CHANGED_ON'] = date("Y-m-d H:i:s");$data['CHANGED_BY']     = $_SERVER['REMOTE_ADDR'];$data['STATUS']         = 1;

$this->MProject->ins_system_log($data);
}

}

}

You can avoid repeating whole blocks of code by isolating the dynamic components of your function and assign them to an array. Then as you wish to modify the fields/columns to be checked, you merely need to update the array and not the functional/checking parts.

public function edit_project_master(){
$no_pro = 'PRJ-2017-501';$check_pro  = $this->MProject->get_det_pro($no_pro); //get data form table

$checklist=[ ['input'=>'na_pro','column'=>'NAMA_PROJECT','table'=>'PM_REQUIREMENT_PROJECT'], ['input'=>'i_metode','column'=>'JADWAL_PROJECT','table'=>'PM_REQUIREMENT_PROJECT'] ]; //checking script foreach($check_pro as $res_check_pro){ foreach($checklist as $listrow){$pro = $this->input->post($listrow['input']); //value for edit
if($pro !=$res_check_pro[$listrow['column']]){ //IF VALUE DIFFERENT foreach($res_check_pro as $key_pro =>$val_pro){
if($res_check_pro[$listrow['column']] == $val_pro){$col_name = $key_pro; //GET COLUMN NAME break; // I assume you want to break as soon as you find a match } }$data['ACTIVITY']       = "UPDATE";
$data['OLD_VALUE'] =$res_check_pro[$listrow['column']];$data['NEW_VALUE']      = $pro;$data['COL_AFFECTED']   = $col_name;$data['TABLE_AFFECTED'] = $listrow['table']; // I'm not sure how you mean "automatically", this is "dynamically"$data['ANNOTATION']     = NULL;
$data['EXECUTOR'] =$this->session->userdata('nip');
$data['CHANGED_ON'] = date("Y-m-d H:i:s");$data['CHANGED_BY']     = $_SERVER['REMOTE_ADDR'];$data['STATUS']         = 1;
$this->MProject->ins_system_log($data);
}
}
}
}

Also...

I added break; to the innermost foreach() assuming there will only be one match. This is best practice because it avoids doing pointless iterations.

I made the value for $data['TABLE_AFFECTED'] "dynamic" (modifiable via the $checklist array). I don't know if this is what you had in mind by "automatic".


text:
# 10218. Consecutive 1’s with Function

## Task Description

We have a two-dimensional array. The size of the array is $N$ by $N$. Each element of the array is either 0 or 1.

Write a function to compute the length of the longest continuous “1” along a row, along a columns, or along a diagonal directional. You need to consider both diagonal directions, as shown in the figure below.

sample

## The First Subtask (50%)

In the first subtask you will write a function findLength to help us. The prototype of this function findLength is as follow:

int findLength (int array[][256], int N, int r, int c, int dr, int dc);

The function findLength returns the maximum length of consecutive 1's that we can find from the $r$-th row and the $c$-th column in the direction of ($dr$, $dc$) in an $N$ by $N$ array. Note that the segment of the maximum lenght of consecutive 1's does not necessarily start from $(r, c)$.

We will use the following main program to test your function. You can download it and name it mainTest.c to help test your findLength.

123456789101112131415#include <stdio.h>#include "findLength.h"#define MAXN 256int main () {    int array[MAXN][MAXN];    int N, r, c;    int direction[4][2] = {{1,0}, {1,1}, {0,1}, {-1,1}};    scanf("%d", &N);    for (int i = 0; i < N; i++)        for (int j = 0; j < N; j++)            scanf("%d", &array[i][j]);    scanf("%d%d", &r, &c);    for (int i = 0; i < 4; i++)        printf("%d\n", findLength(array, N, r, c, direction[i][0], direction[i][1]));}

### Compile

You can compile your findLength.c and our mainTest together by the following command.

1gcc -O2 mainTest.c findLength.c

### Input Format

In the first subtasks the first line has an integer $N$, which is the size of the array. The next $N$ lines have $N$ integers, which are either 1 or 0. They are elements of the array. At the end there are two integer $r$ and $c$, where ($r$, $c$) is the position to test findLength.

• $1\leq N\leq 256$

### Output Format

For the first subtask, there are four lines in the output. Each line has one integer that is the length of consecutive “1” in that direction.

### Sample Input 1

51 0 1 1 01 0 0 1 10 1 1 1 10 1 1 0 10 1 0 1 13 1

### Sample Output 1

2123

## The Second Subtask (50%)

In the second task you need to implement your main program (main.c) to find the maximum length of consecutive 1's by calling your findLength function.

### Input Format

This is the same as in the first subtask except that it does not have $r$ and $c$ at the end.

### Output Format

Output the maximum length of consecutive 1 in the array.

### Compile

We will test your programs by the following.

1gcc -O2 main.c findLength.c

### Sample Input 2

51 0 1 1 01 0 0 0 10 1 1 1 10 1 0 0 10 0 0 1 0

### Sample Output 2

4

### Attention

You must submit two source files.

If you only complete findLength.c, you can submit your main.c as follow.

12int main(){}

## Testdata Set

Download Testdata


text:
Vol. 1, No. 1, 2019

 Recent Issues Volume 1, Issue 3 Volume 1, Issue 2 Volume 1, Issue 1
 The Journal About the Journal Subscriptions Editorial Board Submission Guidelines Submission Form Ethics Statement Editorial Login To Appear ISSN (electronic): 2578-5885 ISSN (print): 2578-5893 Other MSP Journals
Dispersive estimates for the wave equation on Riemannian manifolds of bounded curvature

Yuanlong Chen and Hart F. Smith

Vol. 1 (2019), No. 1, 101–148
Abstract

We prove space-time dispersive estimates for solutions to the wave equation on compact Riemannian manifolds with bounded curvature tensor, where we assume that the metric tensor is of ${W}^{1,p}$ regularity for some $p>d$, which ensures that the curvature tensor is well-defined in the weak sense. The estimates are established for the same range of Lebesgue and Sobolev exponents that hold in the case of smooth metrics. Our results are for bounded time intervals, so by finite propagation velocity they hold also on noncompact manifolds under appropriate uniform geometry conditions.

Keywords
wave equation, dispersive estimates
Primary: 58J45
Secondary: 35L15


text:
# Prevent paragraph ending before display equation in TeX4ht

I'm using TeX4ht and I noticed that the displayed equations always forces the current paragraph to end. For example, if I write:

We define
$x = 3$
and continue the discussion.

I would expect only one paragraph produced, but TeX4ht produces two (one before, and one after the equation).

Here is a minimal working example, to be compiled first with latex, then with tex4ht:

\documentclass{article}
\usepackage[xhtml,mathml]{tex4ht}

\begin{document}
We define
$x = 3$
and continue the discussion.
\end{document}

Any idea of a workaround, or a solution?

(I think that I figured out that the TeX4ht file which produces those paragraph ending is html-mml.4ht, but I'm not sure how to fix it)

-

You might add the following after \begin{document} and rerun:

\catcode\:=11
\catcode\@=11
\Configure{[]}
{\SaveEndP
\Configure{@math}{display="block"}%
\csname a:mathml[]\endcsname
\DviMath\Tg<\a:mathml mrow\Hnewline>$$\DisplayMathtrue } {$$\Tg</\a:mathml mrow>\EndDviMath\csname b:mathml[]\endcsname}
\catcode\:=12
\catcode\@=12

-
Thank you. That's a good start, but it does not quite work. First, after the equation, a p tag is produced, which should not be there. Second, that solution works only for the  environment, not for the equation environment, for example... –  Olivier Oct 6 '12 at 15:16


text:
# Thread: [SOLVED] Distribution Function Confusion

1. ## [SOLVED] Distribution Function Confusion

Hello all,

I can't get my stupid head around CDF (Cumulative distribution function). How do you form a single expression (if that's the right word) for F(x) if you have it like this (for example):

$\displaystyle F(x) = 0 \ for \ x < 0$
$\displaystyle F(x) = 1/6 \ for \ 0 < x < 1$
$\displaystyle F(x) = 5/6 \ for \ 1 < x < 2$
$\displaystyle F(x) = 1 \ for \ x > 2$

So what I want to be able to do is write the above as something I can integrate/differentiate or whatever, presuming it's possible. The book I'm using just says "so we write the above as F(x) = blah blah blah" without a single explanation of how to do it. So what I'd like to know is... how do you do it?

(P.s. I'm not too concerned with the answer to the above question, I'm just studying...so whatever examples you want to use are fine).

Thanks.

2. Hello,
Originally Posted by StupidIdiot
Hello all,

I can't get my stupid head around CDF (Cumulative distribution function). How do you form a single expression (if that's the right word) for F(x) if you have it like this (for example):

$\displaystyle F(x) = 0 \ for \ x < 0$
$\displaystyle F(x) = 1/6 \ for \ 0 < x < 1$
$\displaystyle F(x) = 5/6 \ for \ 1 < x < 2$
$\displaystyle F(x) = 1 \ for \ x > 2$

So what I want to be able to do is write the above as something I can integrate/differentiate or whatever, presuming it's possible. The book I'm using just says "so we write the above as F(x) = blah blah blah" without a single explanation of how to do it. So what I'd like to know is... how do you do it?

(P.s. I'm not too concerned with the answer to the above question, I'm just studying...so whatever examples you want to use are fine).

Thanks.
You can't differentiate that, since it's not continuous.
This cdf is characteristic of the cdf of a discrete rv.
I assume it's rather :

$\displaystyle F(x)=\begin{cases} 0 & x<0 \\ \frac 16 & 0 {\color{red}\leq} x<1 \\ \frac 56 & 1 {\color{red}\leq} x<2 \\ 1 & x {\color{red}\geq} 2 \end{cases}$

This means that :
$\displaystyle \mathbb{P}(X=0)=\frac 16$
$\displaystyle \mathbb{P}(X=1)=\frac 56-\frac 16=\frac 23$
$\displaystyle \mathbb{P}(X=2)=1-\frac 56=\frac 16$

And that's all..

Cumulative distribution function - Wikipedia, the free encyclopedia

Originally Posted by Moo
I assume it's rather :

$\displaystyle F(x)=\begin{cases} 0 & x<0 \\ \frac 16 & 0 {\color{red}\leq} x<1 \\ \frac 56 & 1 {\color{red}\leq} x<2 \\ 1 & x {\color{red}\geq} 2 \end{cases}$
Sorry, that was a bad example to give. I just made it up myself just to ask the question. You're right about the inequalities.

Originally Posted by Moo
You can't differentiate that, since it's not continuous.
This cdf is characteristic of the cdf of a discrete rv.
So...if it was continuous, could you do it?

Given X is a continuous random variable whose distribution function F satisfies:

$\displaystyle F(x) = 0 \ for \ x < 0$
$\displaystyle F(x) = 1 \ for \ x > 0$
$\displaystyle F(x) = x(2-x) \ for \ 0\leq x \leq 1$

Find E[x].

I think you need the density function for this question. So how do you convert the distribution function to the density function in this example?

(There's no need to find E[x], I just need the f(x) and I can do it myself I hope...I don't want to waste anyone's time anymore than is necessary. The answer is 1/3 apparently).

Thanks for the help.

4. Originally Posted by StupidIdiot
So...if it was continuous, could you do it?
Yep

Given X is a continuous random variable whose distribution function F satisfies:

$\displaystyle F(x) = 0 \ for \ x < 0$
$\displaystyle F(x) = 1 \ for \ x > {\color{red}1}$
$\displaystyle F(x) = x(2-x) \ for \ 0\leq x \leq 1$

Find E[x].
Should be 1, not 0 (in red)

I think you need the density function for this question. So how do you convert the distribution function to the density function in this example?
Yes, you need the pdf (probability density function).
Which can be found as the derivative of the cumulative distribution function (what you call "distribution function")

So for $\displaystyle x<0$, the derivative is 0.
For $\displaystyle x>1$, the derivative of 1 is 0.
For $\displaystyle 0\leq x\leq 1$, the derivative is... ?

Note that the pdf doesn't need to be continuous. =)

(There's no need to find E[x], I just need the f(x) and I can do it myself I hope...I don't want to waste anyone's time anymore than is necessary. The answer is 1/3 apparently).

Thanks for the help.
It's not that it would waste our time, it's just that if you can show what you've done/tried, and that you want us to check, it's always better. And it's very welcome

5. Originally Posted by Moo
Should be 1, not 0 (in red)
You're right again. I typed in the question wrong.

Originally Posted by Moo
Yes, you need the pdf (probability density function).
Which can be found as the derivative of the cumulative distribution function (what you call "distribution function")

So for $\displaystyle x<0$, the derivative is 0.
For $\displaystyle x>1$, the derivative of 1 is 0.
For $\displaystyle 0\leq x\leq 1$, the derivative is... ?

Note that the pdf doesn't need to be continuous. =)
Ok, so really the first two parts are "unimportant" when it comes to the differentiation. I presume then:

$\displaystyle PDF = \frac{d}{dx}F(x)$

$\displaystyle f(x)= \frac{d}{dx}x(2-x)$

$\displaystyle f(x)= \frac{d}{dx}2x - x^2$

$\displaystyle f(x)= 2-2x$

$\displaystyle E[x] = \int_0^1 xf(x)dx$
$\displaystyle E[x] = \int_0^1 2x-2x^2dx$
$\displaystyle E[x] = (x^2-\frac{2}{3}x^3)_0^1$
$\displaystyle E[x] = \frac{1}{3}$

Originally Posted by Moo
It's not that it would waste our time, it's just that if you can show what you've done/tried, and that you want us to check, it's always better. And it's very welcome
Thanks for the help Moo! I think I understand now. It's kind of more simple than I thought it might be.

6. Thanks for the help Moo! I think I understand now. It's kind of more simple than I thought it might be.
Yep, you went through it ^^

The "first two parts" are not "unimportant".
It's just that the derivative in these intervals is 0.

The pdf can be written with an indicator function (which is equivalent to restrict it to a certain domain)

Here :
$\displaystyle f(x)=2(2-x) \bold{1}_{[0,1]}(x)$, where :
$\displaystyle \bold{1}_{[0,1]}(x)=\begin{cases} 1 \text{ if } x \in [0,1] \\ 0 \text{ otherwise} \end{cases}$

Or just say that
$\displaystyle f(x)=\begin{cases} 2(2-x) \text{ if } x \in [0,1] \\ 0 \text{ otherwise}\end{cases}$

7. Originally Posted by Moo
The "first two parts" are not "unimportant".
It's just that the derivative in these intervals is 0.
I knew that you wouldn't like me saying unimportant! Well, I just meant in this particular case for this particular problem that those first parts don't directly come into the differentiation.

Originally Posted by Moo
The pdf can be written with an indicator function (which is equivalent to restrict it to a certain domain)

Here :
$\displaystyle f(x)=2(2-x) \bold{1}_{[0,1]}(x)$, where :
$\displaystyle \bold{1}_{[0,1]}(x)=\begin{cases} 1 \text{ if } x \in [0,1] \\ 0 \text{ otherwise} \end{cases}$

Or just say that
$\displaystyle f(x)=\begin{cases} 2(2-x) \text{ if } x \in [0,1] \\ 0 \text{ otherwise}\end{cases}$
Ok good to know. I've never seen lunacy like this before:

$\displaystyle f(x)=2(2-x) \bold{1}_{[0,1]}(x)$, where :
$\displaystyle \bold{1}_{[0,1]}(x)=\begin{cases} 1 \text{ if } x \in [0,1] \\ 0 \text{ otherwise} \end{cases}$

...but it makes sense. And I understand the:

$\displaystyle f(x)=\begin{cases} 2(2-x) \text{ if } x \in [0,1] \\ 0 \text{ otherwise}\end{cases}$

I might just use it some time. Right, once again thanks! I'll slap a "solved" on this thread (if that's possible).


text:
# CLIPLX - Editorial

Author: Avijit Agarwal
Tester and Editorialist: Soumik Sarkar

Cakewalk

None

# PROBLEM

X points are required from Y matches. For each match, a loss gives 0 points, a tie gives 1 point and a win gives 2 points. Gather X points using minimum number of wins.

# EXPLANATION

If X \leq Y, it is possible to tie X matches and get the required points.
If X > Y, one must win exactly X - Y matches and tie the rest.

The answer can be expressed as \max(0, X - Y).

Time complexity is \mathcal{O}(1) per case.

# AUTHOR’S AND TESTER’S SOLUTIONS

Author’s solution can be found here.
Tester’s solution can be found here.

1 Like

#what’ s the problem in this code, you didn’t notice one condition is that , for 3 and 5 case : 2
for i in range (int(input())):
r,x=map(int,input().split())
f=r/2
if f<1:
print(“0”)
elif r%2==0:
print(int(f))
else:
h=r+1
p=h/2
if p>1:
print( int§ )


text:
# How to add Windows 7 to GRUB2?

I am currently using Ubuntu 12.04 LTS and I want to dual boot it with Windows 7. Let me explain what did I do:

1. There was only Ubuntu 12.04 on and I get it's image with clonezilla. Ubuntu was installed on sda which is 128 GB SSD and there was a 1TB harddisk for another purposes.
2. I desperatly try to install Windows 7 alongside ubuntu but I can't managed it. Windows 7 could not recognize my hard drives.
3. So I searched and changed my bios settigs to IDE from RAID.
4. I accomplished to install Win7 on sdb1.
5. Now I have a running Win7 but there is no sign of SSD on windows. (I know there won't be any ubuntu at boot because mbr writing over grub.)
6. After installation I tried to re-install grub but I failed.
7. I used a software named "boot-repair" but that failed too.
8. I switched my BIOS settings to RAID from IDE and now win7 is not booting.
9. I tried to use repair tool in windows 7 installation disk which is another fail.
10. Switched back to RAID and installed brand new ubuntu on sda.
11. Used clonezilla to restore my first ubuntu back on sda.
12. Tried to use "boot-repair" but failed again.

Current situation:

In BIOS in storage device options my settings is RAID. I have ubuntu installed on my sda. I have win7 installed on my sdb1. My boot is grub and it only shows ubuntu.

And here is an information about my disks situation which is created with "boot-repair"

http://paste.ubuntu.com/5665110/

My question and desire is simple. I want to dual boot these two systems. If I can add win7 which is in sdb1 at the moment into grub2 my problem will be solved. You can answer it here or I am willing to read any guide you can link to me. But I must say I read a lot of guides none helped. Bootloader could be grub or mbr doesn't matter. I can format all the harddisks there is no important information on both ssd and hdd (which I tried but I failed that too.). I have an external 1tb usb harddrive (if it can help any).

-
Take a look at Installing Ubuntu –  Mitch Mar 31 '13 at 19:27
–  user68186 Apr 1 '13 at 14:15

This answer is rather late, but it may help someone else.

I suspect the problem is due to you having the RAID enabled at the time of the install. With most fake RAID controllers (almost certainly the sort that you have on your board) the RAID BIOS routines will create a special on-disk format. If the disk is then connected with the RAID switched off, then the regular system will not be able to read anything that is on that disk.

Check if with RAID OFF either disk will boot. If not, the way to proceed is to ensure that RAID is off in your BIOS, then wipe each disk and re-install the OS you want to each of the two drives (if one disk boots then it does not need to be reinstalled).

Check that each disk will boot as the sole (and usually first) disk in the system.

Then ensure that you are booting from the first disk with Ubuntu installed. You can then add the Win disk as the second drive and add its stanza to Ubuntu grub, either manually or using boot-repair.

The only time you need to have RAID on is with multiple hard drives of the same size for striping or for data redundancy. NEVER turn it on with two disks of different sizes or types (unless you know exactly why you are doing so, of course!). And as a last point, if you do need RAID, most people will find that Linux software RAID is better than all fake-RAID (and often hardware RAID that costs less than \$350 and does not have dedicated memory)...

-

Try os-prober and update-grub, if you haven't already.

-
While this question may be correct, When you supply an answer, please could you try and offer a reason why, and the method for using your answer and where to get the programmes from. –  SimplySimon Sep 7 '13 at 15:13
@SimplySimon These are commands present on any Ubuntu system, except one where GRUB has been completely uninstalled (quite uncommon). With that said, and while this is an answer, you're right that more explanation would help a lot. –  Eliah Kagan Sep 7 '13 at 15:48


text:
# Algebra Practice Quiz 3

5 Steps - 3 Clicks

# Algebra Practice Quiz 3

### Introduction

Algebra is a division of mathematics designed to help solve certain types of problems quicker and easier. Algebra is based on the concept of unknown values called variables, unlike arithmetic which is based entirely on known number values.

The article Algebra Practice Quiz 3 is useful for candidates preparing for different competitive examinations like RRB ALP/Technical Exams/Junior Engineer Recruitment Exams, SSC, IBPS PO Exams and etc.

### Quiz

1.
Statement: M ≥ P T = M
Conclusions:
I. V ≥ P
II. T ≥ H

A. If only conclusion I is true
B. If only conclusion II is true
C. If either conclusion I or II is true
D. If neither conclusion I nor II is true
E. If both conclusions I and II are true

Explanation:
M ≥ P T = M …… (ii)
Combining all statements, we get
V ≥ T = M ≥ P P is true.
Again, T ≥ H is not true.

2.
Statements: A ≥ B = C ≥ D, V ≥ G ≤ H = D
Conclusion:
I. C ≥ D
II. A ≥ H
III. B ≥ G
IV. C ≤ V

A. Only I and II are true
B. Only III and IV are true
C. Only I, II and III are true
D. All I, II and III are true
E. None of these

Explanation:
A ≥ B = C ≥ D …..(i)
V ≥ G ≤ H = D ……(ii)
Combining both statement, we get
A ≥ B = C ≥ D = H ≥ G ≤ V
Thus, C ≥ G is true.
A ≥ H is true. B ≥ G is true. C ≤ V is not true.
Hence, only I, II and III are true.

3.
Statements: M ≤ N T ≥ Q
Conclusions:
I. R ≥ L
II. T ≤ N
III. L ≥ M
IV. R ≥ M

A. Only III and IV are true
B. Only III is true
C. Only I and IV are true
D. All I, II, III and IV are true
E. None of these

Explanation:
M ≤ N T ≥ Q ……(ii)
Combining both the statements, we get
M ≤ N ≤ L ≥ Q ≤ T ≤ R
Thus, R ≥ L is not true.
T ≤ N is not true.
Again, M M is true.
R ≥ M is not true.

4.
Statement: M ≥ P T = M
Conclusions:
I. V ≥ P
II. T ≥ H

A. If only conclusion I is true
B. If only conclusion II is true
C. If either conclusion I or II is true
D. If neither conclusion I nor II is true
E. If both conclusions I and II are true

Explanation:
M ≥ P T = M …… (ii)
Combining all statements, we get
V ≥ T = M ≥ P P is true.
Again, T ≥ H is not true.

5.
Statements: E = G ≥ H = N, C ≥ F ≥ M = N
Conclusions:
I. F ≥ E
II. E ≥ M
III. C ≥ G
IV. C ≥ H

A. Only I and III are true
B. All I, II, III and IV are true
C. Only II and IV are true
D. Only II is true
E. None of these

Explanation:
E = G ≥ H = N ……(i)
C ≥ F ≥ M = N …….(ii)
Combining both the statements, we get
E = G ≥ H = N = M ≤ F H or H ≤ C is true.

In each of these questions, two equations (I) and (II) are given. You have to solve both the equations and give answer.

1.
I. $$x^{5}$$ – 41$$x^{3}$$ + 400x = 0
II. $$y^{2}$$ – 14y + 30 = −18

A. if x ≥ y
B. if x ≤ y
C. if x ≥ y
D. if x ≤ y
E. if x = y or relationship between x and y can’t be established

Explanation:
I. $$x^{5}$$ – 41$$x^{3}$$ + 400x = 0
x($$x^{4}$$ – 41$$x^{2}$$ + 400) = 0
x = 0 or $$x^{4}$$ – 41$$x^{2}$$ + 400 = 0
Let $$x^{2}$$ = a
$$a^{2}$$ – 41a + 400 = 0 ∴ $$a^{2}$$ – 25a − 16a + 400 = 0
(a – 16)(a – 25) = 0
a = 16 or a = 25
$$x^{2}$$ = 16 or $$x^{2}$$ = 25
x = ±4 or x = ±5
x = −5 or −4 or 0 or 4 or 5
II. $$y^{2}$$ – 14y + 30 = −18
$$y^{2}$$ – 14y + 48 = 0
$$y^{2}$$ – 8y − 6y + 48 = 0
(y – 6)(y – 8) = 0
y = 6 or y = 8
For both values of y

2.
I. $$x^{2}$$ – 3 = 2x
II. $$y^{2}$$ + 5y + 6 = 0

A. if x ≥ y
B. if x ≤ y
C. if x ≥ y
D. if x ≤ y
E. if x = y or relationship between x and y can’t be established

Explanation:
I. $$x^{2}$$ – 3 = 2x
$$x^{2}$$ – 2x – 3 = 0
$$x^{2}$$ – 3x + x – 3 = 0
(x + 1)(x – 3) = 0
x = 3 or x = −1
II. $$y^{2}$$ + 5y + 6 = 0
$$y^{2}$$ + 3y + 2y + 6 = 0
(y + 3)(y + 2) = 0
y = –3 or y = –2
For both values of x, x ≥ y

3.
I. 4$$x^{3}$$ + 24$$x^{2}$$ – 64x = 0
II. 3$$y^{2}$$ + 39y + 126 = 0

A. if x ≥ y
B. if x ≤ y
C. if x ≥ y
D. if x ≤ y
E. if x = y or relationship between x and y can’t be established

Explanation:
I. 4$$x^{3}$$ + 24$$x^{2}$$ – 64x = 0
4x($$x^{2}$$ + 6x – 16) = 0
4x = 0 or $$x^{2}$$ + 6x – 16 = 0 (Here 4x = 0 is nothing but x = 0)
$$x^{2}$$ + 6x – 16 = 0
$$x^{2}$$ + 8x − 2x – 16 = 0
(x − 2)(x + 8) = 0
x = 2 or x = −8
x = −8, 0 or 2
II. 3$$y^{2}$$ + 39y + 126 = 0
$$y^{2}$$ + 13y + 42 = 0
$$y^{2}$$ + 7y + 6y + 42 = 0
(y + 7)(y + 6) = 0
y = –7 or y = –6 When x = −8, x y Hence, no relation can be established between x and y.

4.
I. $$x^{2}$$ – 25x + 114 = 0
II. $$y^{2}$$ – 10y + 24 = 0

A. if x ≥ y
B. if x ≤ y
C. if x ≥ y
D. if x ≤ y
E. if x = y or relationship between x and y can’t be established

Explanation:
I. $$x^{2}$$ – 25x + 114 = 0
$$x^{2}$$ – 19x – 6x + 114 = 0
(x – 6)(x – 19) = 0
x = 19 or x = 6
II. $$y^{2}$$ – 10y + 24 = 0
$$y^{2}$$ – 6y – 4y + 24 = 0
(y – 4)(y – 6) = 0
y = 6 or y = 4
When x = 19, x ≥ y
When x = 6, x ≥ y
Hence, x ≥ y

5.
I. 48$$x^{2}$$ – 24x + 3 = 0
II. 55$$y^{2}$$ + 53y + 12 = 0

A. if x ≥ y
B. if x ≤ y
C. if x ≥ y
D. if x ≤ y
E. if x = y or relationship between x and y can’t be established

Explanation:
48$$x^{2}$$ – 24x + 3 = 0 is of the form a$$x^{2}$$ – bx + c = 0
Both roots of this equation are positive i.e. x ≥ 0
55$$y^{2}$$ + 53y + 12 = 0 is of the form a$$y^{2}$$ + by + c = 0
Both roots of this equation are negative i.e. y

1. If a two-digit number is added to a number obtained by reversing the digits of the given number, then the sum is always divisible by which one of the following numbers?

A. 7
B. 9
C. 10
D. 11

Explanation:
Let a two-digit number be (10x + y) and reversing number be (10y + x)
Required sum = 10x + y + 10y + x = 11x + 11y = 11(x + y)
Hence, it’s divisible by 11.

2. What is the sum of two numbers whose differences is 45 and the quotient of the greater number by the lesser number is 4?

A. 100
B. 90
C. 80
D. 75

Explanation:
Let the greater number be x and smaller number be y
x – y = 45 ….. (i)
x = 4y ….. (ii)
From eqs. (i) and (ii)
4y – y = 45
y = $$\frac{45}{3}$$= 15
On putting the value of y in Eq. (ii), we get
x = 4 × 15 = 60
Hence, required sum = x + y = 60 + 15 = 75.

3. If one-third of a two-digit number exceeds its one-fourth by 8, then what is the sum of the digits of the number?

A. 6
B. 13
C. 15
D. 17

Explanation:
Let the number be y,
$$\frac{y}{3}$$=$$\frac{y}{4}$$ + 8
$$\frac{4y – 3y}{12}$$=8
y = 12 × 8 = 96
Sum of digits = 9 + 6 = 15.

4. A person bought 5 tickets from a station P to a station Q and 10 tickets from the station P to a station R. He paid Rs. 350. If the sum of a ticket from P to Q and a ticket from P to R is Rs. 42, then what is the fare from P to Q?

A. Rs. 12
B. Rs. 14
C. Rs. 16
D. Rs. 18

Explanation:
Let the fare from station P to station Q is ₹ x and the fare from station P to station R is ₹ y.
By given condition, x + y = 42 …..(i)
and 5x + 10y = 350 …. (ii)
On solving Eqs. (i) and (ii), we get
x = 14 and y = 28
Hence, fare from station P to station Q is Rs. 14.

5. If 6x – 5y = 13, 7x + 2y = 23 then 11x + 18y = ?

A. – 15
B. 51
C. 33
D. 15

Explanation:
6x – 5y = 13 …… (i)
7x + 2y = 23 …… (ii)
By equation (i) * 2 & (ii) * 5,
12x – 10y = 26 ….. (iii)
35x + 10y = 115 …… (iv)
by solving these equation we get
x = 3, y = 1
11x + 18y = 11 × 3 + 18 × 1 = 33 + 18 = 51.

### Exams

Competitive Exams – College
Entrance Exams
Diploma Goa Diploma
###### GATE 2020

Competitive Exams – Recent Job Notifications
Category
Banking SSC Railway
Defence Police Insurance

### SP Quiz

Competitive Exams – Practice Sets
Category Quiz
Quant Aptitude Probability
Insurance Awareness Insurance Awareness

### GK

General Knowledge for Competitive Examinations
Topic Name of the Article
GK – World World Longest Train Services
Important Newspapers

GK – India Union Budget 2019 Highlights

Information Technology

GK – Abbreviations Science Information Technology Abbreviations

Sports Abbreviations
GK – Banking & Insurance Indian Banks Association
Monetary Policy Committee

GK – Science & Technology Zoology Terminology

Unit of Measurement


text:
# How to make sure the tail of a rho-shaped graph remains on the left?

This question is a sequel to this other question, nicely solved by @marmot. The new question is due to a new situation that arises. In the new sequence 2, 12, 34, [43, 28, 25], where brackets denote the cycle, the tail ends up on the right side, presenting a backwards rho-letter.

Question. How to make sure the tail remains on the left side, resembling a rho-shaped graph?

Remark. I'd like to stress that the current picture is quite good! I consider any positive answer to this question a luxury, which I'll appreciate having.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{chains,positioning,calc,intersections}
\begin{document}

\begin{tikzpicture}[node distance=1cm]
\pgfmathsetmacro{\Radius}{3.5}
\path[name path=big circle] (0,0) circle (\Radius cm);
\def\cyclelen{3}
\foreach \X [count=\Y] in {28,25,43}
{\node[name path global=\Y-circ,inner sep=4pt,circle]  (cn\Y) at
({-(\Y-2.5)*360/\cyclelen}:\Radius) {$\X$}; }
\foreach \Y [remember=\Y as \LastY (initially \cyclelen)]in {1,...,\cyclelen}
{
\path[name intersections={of=big circle and \LastY-circ,by={aux0,aux2},sort
by=big circle},
name intersections={of=big circle and \Y-circ,by={aux1,aux3},sort
by=big circle}];
\draw[-latex]
let \p1=($(aux0)-(0,0)$),\p2=($(aux3)-(0,0)$),
\n1={atan2(\y1,\x1)},\n2={atan2(\y2,\x2)},
\n3={(ifthenelse(\n2<\n1,\n2,\n2-360)} in
(aux0) arc(\n1:\n3:\Radius);
}

\begin{scope}[start chain = going below,
every node/.append style={on chain,,xshift=-{cot(76)*1.5cm}},
every join/.style=latex-]
\node[below=of cn\cyclelen] (n0) {$34$};
\draw[latex-] (cn\cyclelen) -- (n0);
\node[join] (n1) {$12$};
\node[join] (n0) {$2$};
\end{scope}
\end{tikzpicture}
\end{document}

• You only need to use \node[name path global=\Y-circ,inner sep=4pt,circle] (cn\Y) at ({-(\Y-4.5)*360/\cyclelen}:\Radius) {$\X$};, i.e. replace (\Y-2.5) by (\Y-4.5). 2.5 and 4.5 represent offset angles of the first node. – marmot Jan 8 at 20:31
• I guess it turned out quite simple. You should add that an answer as it not only answered, by taught me how to make further adjustments I might need. Thank you so much. – Joep Awinita Jan 8 at 20:33

## 1 Answer

If you want to make sure that the node is one the left, this can be achieved by setting

 \node[name path global=\Y-circ,inner sep=4pt,circle]  (cn\Y) at ({180-\Y*360/\cyclelen}:\Radius) {$\X$};

The reasons why I decided to write an answer are:

1. In my previous answer I have not considered the special case that the circle may start and end between two nodes in an "unfortunate way". (You may say that there is no point at which a circle starts or ends, which is true, but the path along which the intersections get ordered does start and end somewhere.) So changed the strategy slightly, which also speeds up the compilation a bit.
2. Besides, you do not have to count the number of entries yourself, TikZ can do that for you. So all you need to do is to enter the nodes you wish to draw via \def\mylist{28,25,43} and TikZ will do the rest.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{chains,positioning,calc,intersections}
\begin{document}

\begin{tikzpicture}[node distance=1cm]
\pgfmathsetmacro{\Radius}{3.5}
\def\mylist{28,25,43}
\foreach \X [count=\Y] in \mylist
{\xdef\cyclelen{\Y}}
\foreach \X [count=\Y] in \mylist
{\node[name path global=\Y-circ,inner sep=4pt,circle]  (cn\Y) at
({180-\Y*360/\cyclelen}:\Radius) {$\X$}; }
\foreach \Y [remember=\Y as \LastY (initially \cyclelen)]in {1,...,\cyclelen}
{
\path[name path=arc] let \p1=($(cn\LastY.center)-(0,0)$),\p2=($(cn\Y.center)-(0,0)$),
\n1={atan2(\y1,\x1)},\n2={atan2(\y2,\x2)},\n3={ifthenelse(\n2<\n1,\n2,\n2-360)}
in (cn\LastY.center) arc(\n1:\n3:\Radius);
\path[name intersections={of=arc and \LastY-circ,by=aux0},
name intersections={of=arc and \Y-circ,by=aux1}];
\draw[-latex] let \p1=($(aux0)-(0,0)$),\p2=($(aux1)-(0,0)$),
\n1={atan2(\y1,\x1)},\n2={atan2(\y2,\x2)},\n3={(ifthenelse(\n2<\n1,\n2,\n2-360)}
in (aux0) arc(\n1:\n3:\Radius);
}
\begin{scope}[start chain = going below,
every node/.append style={on chain,xshift=-{cot(76)*1.5cm}},
every join/.style=latex-]
\node[below=of cn\cyclelen] (n0) {$34$};
\draw[latex-] (cn\cyclelen) -- (n0);
\node[join] (n1) {$12$};
\node[join] (n0) {$2$};
\end{scope}
\end{tikzpicture}
\end{document}


text:
# Package net.finmath.montecarlo

Provides basic interfaces and classes used in Monte-Carlo models (like LIBOR market model or Monte-Carlo simulation of a Black-Scholes model), e.g., the Monte-Carlo random variable and the Brownian motion.
Author:
Christian Fries
• Interface Summary
Interface Description
BrownianMotion
Interface description of a time-discrete n-dimensional Brownian motion W = (W1,...,Wn) where Wi is a Brownian motion.
IndependentIncrements
Interface description of a time-discrete n-dimensional stochastic process $$X = (X_{1},\ldots,X_{n})$$ provided by independent increments $$\Delta X(t_{i}) = X(t_{i+1})-X(t_{i})$$.
MonteCarloProduct
Interface for products requiring an MonteCarloSimulationModel for valuation.
MonteCarloSimulationModel
The interface implemented by a simulation of an SDE.
RandomVariableFactory
A factory for creating objects implementing net.finmath.stochastic.RandomVariable.
• Class Summary
Class Description
AbstractMonteCarloProduct
Base class for products requiring an MonteCarloSimulationModel for valuation.
AbstractRandomVariableFactory
BrownianBridge
This class implements a Brownian bridge, i.e., samples of realizations of a Brownian motion conditional to a given start and end value.
BrownianMotionFromMersenneRandomNumbers
Implementation of a time-discrete n-dimensional Brownian motion W = (W1,...,Wn) where Wi is a Brownian motion and Wi, Wj are independent for i not equal j.
BrownianMotionFromRandomNumberGenerator
Implementation of a time-discrete n-dimensional Brownian motion W = (W1,...,Wn) where Wi is a Brownian motion and Wi, Wj are independent for i not equal j.
BrownianMotionLazyInit Deprecated.
Refactor rename.
BrownianMotionView
A Brownian motion which is defined by some factors of a given Brownian motion, i.e., for a given multi-factorial Brownian motion W, this Brownian motion is given by ( W(i[0]), W(i[1]) W(i[2]), ..., W(i[n-1]) ) where i is a given array of integers.
BrownianMotionWithControlVariate
Provides a Brownian motion from given (independent) increments and performs a control of the expectation and the standard deviation.
CorrelatedBrownianMotion
Provides a correlated Brownian motion from given (independent) increments and a given matrix of factor loadings.
GammaProcess
Implementation of a time-discrete n-dimensional Gamma process $$\Gamma = (\Gamma_{1},\ldots,\Gamma_{n})$$, where $$\Gamma_{i}$$ is a Gamma process and $$\Gamma_{i}$$, $$\Gamma_{j}$$ are independent for i not equal j.
IndependentIncrementsFromICDF
Implementation of a time-discrete n-dimensional sequence of independent increments W = (W1,...,Wn) form a given set of inverse cumulative distribution functions.
JumpProcessIncrements
Implementation of a time-discrete n-dimensional jump process J = (J1,...,Jn) where Ji is a Poisson jump process and Ji, Jj are independent for i not equal j.
MertonJumpProcess
Implementation of the compound Poisson process for the Merton jump diffusion model.
RandomVariableFloatFactory
RandomVariableFromArrayFactory
A factory (helper class) to create random variables.
RandomVariableFromDoubleArray
The class RandomVariableFromDoubleArray represents a random variable being the evaluation of a stochastic process at a certain time within a Monte-Carlo simulation.
RandomVariableFromFloatArray
The class RandomVariableFromFloatArray represents a random variable being the evaluation of a stochastic process at a certain time within a Monte-Carlo simulation.
RandomVariableLazyEvaluation
Implements a Monte-Carlo random variable (like RandomVariableFromDoubleArray using late evaluation of Java 8 streams Accesses performed exclusively through the interface RandomVariable is thread safe (and does not mutate the class).
RandomVariableLazyEvaluationFactory
VarianceGammaProcess
Implementation of a time-discrete n-dimensional Variance Gamma process via Brownian subordination through a Gamma Process.


text:
# Shallow-shelf approxmation

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The shallow shelf equations are given by

\begin{align} & \frac{\partial }{\partial x}\left( 2\bar{\eta }H\left( 2\frac{\partial u}{\partial x}+\frac{\partial v}{\partial y} \right) \right)+\frac{\partial }{\partial y}\left( \bar{\eta }H\left( \frac{\partial u}{\partial y}+\frac{\partial v}{\partial x} \right) \right)=\rho gH\frac{\partial s}{\partial x} \\ & \frac{\partial }{\partial y}\left( 2\bar{\eta }H\left( 2\frac{\partial v}{\partial y}+\frac{\partial u}{\partial x} \right) \right)+\frac{\partial }{\partial x}\left( \bar{\eta }H\left( \frac{\partial u}{\partial y}+\frac{\partial v}{\partial x} \right) \right)=\rho gH\frac{\partial s}{\partial y} \\ \end{align},

where u and v are the depth-independent x and y components of velocity, $\bar{\eta }$ is the depth-averaged effective viscosity, H is the ice thickness, ρ is the ice density, g is the acceleration due to gravity, and s=s(x,y) is the ice surface elevation.

Notice the symmetry in the equations. This means that, computationally, many of the same subroutines can be used for discretization.


text:
# dask_ml.decomposition.IncrementalPCA¶

class dask_ml.decomposition.IncrementalPCA(n_components=None, whiten=False, copy=True, batch_size=None, svd_solver='auto', iterated_power=0, random_state=None)

Incremental principal components analysis (IPCA). Linear dimensionality reduction using Singular Value Decomposition of the data, keeping only the most significant singular vectors to project the data to a lower dimensional space. The input data is centered but not scaled for each feature before applying the SVD. Depending on the size of the input data, this algorithm can be much more memory efficient than a PCA, and allows sparse input. This algorithm has constant memory complexity, on the order of batch_size * n_features, enabling use of np.memmap files without loading the entire file into memory. For sparse matrices, the input is converted to dense in batches (in order to be able to subtract the mean) which avoids storing the entire dense matrix at any one time. The computational overhead of each SVD is O(batch_size * n_features ** 2), but only 2 * batch_size samples remain in memory at a time. There will be n_samples / batch_size SVD computations to get the principal components, versus 1 large SVD of complexity O(n_samples * n_features ** 2) for PCA. Read more in the User Guide. .. versionadded:: 0.16

Parameters: n_components : int or None, (default=None) Number of components to keep. If n_components  is None, then n_components is set to min(n_samples, n_features). whiten : bool, optional When True (False by default) the components_ vectors are divided by n_samples times components_ to ensure uncorrelated outputs with unit component-wise variances. Whitening will remove some information from the transformed signal (the relative variance scales of the components) but can sometimes improve the predictive accuracy of the downstream estimators by making data respect some hard-wired assumptions. copy : bool, (default=True) If False, X will be overwritten. copy=False can be used to save memory but is unsafe for general use. batch_size : int or None, (default=None) The number of samples to use for each batch. Only used when calling fit. If batch_size is None, then batch_size is inferred from the data and set to 5 * n_features, to provide a balance between approximation accuracy and memory consumption. svd_solver : string {‘auto’, ‘full’, ‘tsqr’, ‘randomized’} auto : the solver is selected by a default policy based on X.shape and n_components: if the input data is larger than 500x500 and the number of components to extract is lower than 80% of the smallest dimension of the data, then the more efficient ‘randomized’ method is enabled. Otherwise the exact full SVD is computed and optionally truncated afterwards. full : run exact full SVD and select the components by postprocessing randomized : run randomized SVD by using da.linalg.svd_compressed. iterated_power: integer random_state: None or integer Parameters used for randomized svd. components_ : array, shape (n_components, n_features) Components with maximum variance. explained_variance_ : array, shape (n_components,) Variance explained by each of the selected components. explained_variance_ratio_ : array, shape (n_components,) Percentage of variance explained by each of the selected components. If all components are stored, the sum of explained variances is equal to 1.0. singular_values_ : array, shape (n_components,) The singular values corresponding to each of the selected components. The singular values are equal to the 2-norms of the n_components variables in the lower-dimensional space. mean_ : array, shape (n_features,) Per-feature empirical mean, aggregate over calls to partial_fit. var_ : array, shape (n_features,) Per-feature empirical variance, aggregate over calls to partial_fit. noise_variance_ : float The estimated noise covariance following the Probabilistic PCA model from Tipping and Bishop 1999. See “Pattern Recognition and Machine Learning” by C. Bishop, 12.2.1 p. 574 or http://www.miketipping.com/papers/met-mppca.pdf. n_components_ : int The estimated number of components. Relevant when n_components=None. n_samples_seen_ : int The number of samples processed by the estimator. Will be reset on new calls to fit, but increments across partial_fit calls.

Methods

 fit(X[, y]) Fit the model with X. fit_transform(X[, y]) Fit the model with X and apply the dimensionality reduction on X. get_covariance() Compute data covariance with the generative model. get_params([deep]) Get parameters for this estimator. get_precision() Compute data precision matrix with the generative model. inverse_transform(X) Transform data back to its original space. partial_fit(X[, y, check_input]) Incremental fit with X. score(X[, y]) Return the average log-likelihood of all samples. score_samples(X) Return the log-likelihood of each sample. set_params(**params) Set the parameters of this estimator. transform(X) Apply dimensionality reduction on X.
__init__(n_components=None, whiten=False, copy=True, batch_size=None, svd_solver='auto', iterated_power=0, random_state=None)

Initialize self. See help(type(self)) for accurate signature.

fit(X, y=None)

Fit the model with X.

Parameters: X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of features. y : None Ignored variable. self : object Returns the instance itself.
fit_transform(X, y=None)

Fit the model with X and apply the dimensionality reduction on X.

Parameters: X : array-like, shape (n_samples, n_features) New data, where n_samples in the number of samples and n_features is the number of features. y : Ignored X_new : array-like, shape (n_samples, n_components)
get_covariance()

Compute data covariance with the generative model.

cov = components_.T * S**2 * components_ + sigma2 * eye(n_features) where S**2 contains the explained variances, and sigma2 contains the noise variances.

Returns: cov : array, shape=(n_features, n_features) Estimated covariance of data.
get_params(deep=True)

Get parameters for this estimator.

Parameters: deep : bool, default=True If True, will return the parameters for this estimator and contained subobjects that are estimators. params : mapping of string to any Parameter names mapped to their values.
get_precision()

Compute data precision matrix with the generative model.

Equals the inverse of the covariance but computed with the matrix inversion lemma for efficiency.

Returns: precision : array, shape=(n_features, n_features) Estimated precision of data.
inverse_transform(X)

Transform data back to its original space.

Returns an array X_original whose transform would be X.

Parameters: X : array-like, shape (n_samples, n_components) New data, where n_samples in the number of samples and n_components is the number of components. X_original array-like, shape (n_samples, n_features)

Notes

If whitening is enabled, inverse_transform does not compute the exact inverse operation of transform.

partial_fit(X, y=None, check_input=True)

Incremental fit with X. All of X is processed as a single batch.

Parameters: X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of features. check_input : bool Run check_array on X. y : Ignored self : object Returns the instance itself.
score(X, y=None)

Return the average log-likelihood of all samples.

See. “Pattern Recognition and Machine Learning” by C. Bishop, 12.2.1 p. 574 or http://www.miketipping.com/papers/met-mppca.pdf

Parameters: X : array, shape(n_samples, n_features) The data. y : Ignored ll : float Average log-likelihood of the samples under the current model
score_samples(X)

Return the log-likelihood of each sample.

See. “Pattern Recognition and Machine Learning” by C. Bishop, 12.2.1 p. 574 or http://www.miketipping.com/papers/met-mppca.pdf

Parameters: X : array, shape(n_samples, n_features) The data. ll : array, shape (n_samples,) Log-likelihood of each sample under the current model
set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters: **params : dict Estimator parameters. self : object Estimator instance.
transform(X)

Apply dimensionality reduction on X.

X is projected on the first principal components previous extracted from a training set.

Parameters: X : array-like, shape (n_samples, n_features) New data, where n_samples in the number of samples and n_features is the number of features. X_new : array-like, shape (n_samples, n_components)


text:
# writers.bpf¶

BPF is an NGA specification for point cloud data. The specification can be found at https://nsgreg.nga.mil/doc/view?i=4202 The PDAL BPF Writer only supports writing of version 3 BPF format files.

## Example¶

{
"pipeline":[
{
"filename":"inputfile.las"
},
{
"type":"writers.bpf",
"filename":"outputfile.bpf"
}
]
}

## Options¶

filename
BPF file to read. The writer will accept a filename containing a single placeholder character (‘#’). If input to the writer consists of multiple PointViews, each will be written to a separate file, where the placeholder will be replaced with an incrementing integer. If no placeholder is found, all PointViews provided to the writer are aggregated into a single file for output. Multiple PointViews are usually the result of using filters.splitter, filters.chipper or filters.divider. [Required]
compression
This option can be set to true to cause the file to be written with Zlib compression as described in the BPF specification. [Default: false]
format

Specifies the format for storing points in the file. [Default: dim]

• dim == Dimension-major (non-interleaved). All data for a single dimension are stored contiguously.
• point == Point-major (interleaved). All data for a single point are stored contiguously.
• byte == Byte-major (byte-segregated). All data for a single dimension are stored contiguously, but bytes are arranged such that the first bytes for all points are stored contiguously, followed by the second bytes of all points, etc. See the BPF specification for further information.
bundledfile
Path of file to be written as a bundled file (see specification). The path part of the filespec is removed and the filename is stored as part of the data. This option can be specified as many times as desired.
Base64-encoded data that will be decoded and written following the standard BPF header.
coord_id
The coordinate ID (UTM zone) of the data. NOTE: Only the UTM coordinate type is currently supported. [Default: 0, with coordinate type set to none]
scale_x, scale_y, scale_z

Scale to be divided from the X, Y and Z nominal values, respectively, after the offset has been applied. The special value “auto” can be specified, which causes the writer to select a scale to set the stored values of the dimensions to range from [0, 2147483647]. [Default: .01]

Note

written value = (nominal value - offset) / scale.

offset_x, offset_y, offset_z

Offset to be subtracted from the X, Y and Z nominal values, respectively, before the value is scaled. The special value “auto” can be specified, which causes the writer to set the offset to the minimum value of the dimension. [Default: auto]

Note

written value = (nominal value - offset) / scale.

Note

Because BPF data is always stored in UTM, the XYZ offsets are set to “auto” by default. This is to avoid truncation of the decimal digits (which may occur with offsets left at 0).

output_dims
If specified, limits the dimensions written for each point. Dimensions are listed by name and separated by commas. X, Y and Z are required and must be explicitly listed.


text:
# MC34063 with external BJT. Why?

See next post in this series here adding a fet

All,

Here is a picture of an LTSpice simulation of a very basic MC34063 step up circuit which is behaving exactly as it should, 5V in 9V out.

I'm trying to adapt this one step at a time until I end up with a circuit featuring multiple isolated outputs with an overall current rated higher than the 1.5A of the MC34063. My next step is to add an external BJT which I've done here :

The real change, aside from the BJT, is that the inductor is now taken out of the MC34063 Switch Collector input, because the collector of the chip is only used to fire the BJT.. and the Inductor is now in the collector of the BJT, so it can get more current.

But as you can see, the output of this circuit gives me 5V ish. The switch is firing as you can see from the ripple.

What obvious thing am I missing here?

EDITS :

After changing to NPN transistor and increasing the load a little, I get this. It seems this particular transistor can sink some 300mA before it has a wobble. Next step is to add the FET. When I get that working I'll post it here because I've seen nowhere on the internet in which a full MC34063 step up of this kind is properly documented.

Thank you everyone for helping me.

Adding models used, I have no idea where I got these from. I downloaded many, this is the only one that works for step-up.

MC34063X.lib (place it in your lib/sub folder)

*==========================================================
* MC34063
* ON Semiconductor
* DC-DC controller
*
* This model was developed for ON Semiconductor by:
* AEI Systems, LLC
* 5777 W. Century Blvd. Suite 876
* Los Angeles, California 90045
*
* This model is subject to change without notice.
* Users may not directly or indirectly re-sell or
* re-distribute this model. This model may not
* be used, modified, or altered
* without the consent of ON Semiconductor.
*
* For more information regarding modeling services,
* model libraries and simulation products, please
* call AEi Systems at (310) 863-8034, or contact
* AEi by email: info@aeng.com. http://www.AENG.com
*
* Revision: 1.0
*==========================================================
**********
.SUBCKT MC34063X swc swe ct 90 2 vdd isns drc
* SW-col SW-em Ct gnd cinv vdd isns drive col
*DC-DC controller

* PSpice translation by Christophe Basso, christophe.basso@onsemi.com

EB5 5 90 Value = { IF ( v(9,90)>2.5 & v(8,90)>2.5, 0, 5 ) }
Q3 ct 22 vdd QN2907
V10 isns 22 DC=.3215
EB6 7 90 Value = { IF ( v(4,90)>2.5 & v(10,90)>2.5, 0, 5 ) }
R3 5 10 100
R9 13 swe 100
C2 10 90 100p IC=5
R4 2 90 10MEG
C10 2 90 50p
R5 7 8 100
C3 8 90 100p IC=0
XTOF1 srst 90 ct 90 SWhyste params: VT=1.25 VH=.8
R1 srst vdd 10k
Q2 drc 14 13 _Q3_mod
EB4 6 90 Value = { IF ( v(2,90) > (v(vref,90) + v(voff,90)), 0, v(vdd,90) ) }
GB2 vdd ct Value = { IF ( V(srst,90) > 3, 35U, -220U ) }
EB3 9 90 Value = { IF ( v(diff,90)  3), 0, v(vdd,90) ) ) }
EB7 16 90 Value = { IF ( V(vdd,90)-1.5 > 1.25, 1.25, IF ( V(vdd,90)-1.25  2.5, 10m, -10m ) }
V4 voff 90 DC=2m
C5 srst diff 10p
EB1 4 90 Value = { IF ( (v(diff,90) > -1), v(vdd,90), 0 ) }
R10 vdd isns 10k
** discrete models **
.MODEL QN2907 PNP BF=200 BR=6 CJC=19PF CJE=23PF IKF=100E-3
+ IS=1.1E-12 ISE=1.3E-11 MJC=.2 MJE=1.25 NE=1.9 NF=1.21 RC=.6
+ TF=5E-10 TR=34E-9 VAF=50 VJC=.5 VJE=.30 XTB=1.5
.MODEL DN4148 D BV=100V CJO=4PF IS=7E-09 M=.45 N=2 RS=.8
+ TT=6E-09 VJ=.6V
.MODEL _Q4_mod NPN BF=50 RC=.125 RE=.125 TF=10n
.MODEL _Q3_mod NPN BF=50
.ENDS
**********
* PSpice hysteresis switch made by Chris Basso
.subckt SWhyste NodeMinus NodePlus Plus Minus PARAMS: RON=1 ROFF=1MEG VT=5 VH=2
S5 NodePlus NodeMinus 8 0 smoothSW
EBcrtl 8 0 Value = { IF ( V(plus)-V(minus) > V(ref), 1, 0 ) }
EBref ref1 0 Value = { IF ( V(8) > 0.5, {VT-VH}, {VT+VH} ) }
Rdel ref1 ref 100
Cdel ref 0 100p IC={VT+VH}
Rconv1 8 0 10Meg
Rconv2 plus 0 10Meg
Rconv3 minus 0 10Meg
.model smoothSW VSWITCH (RON={RON} ROFF={ROFF} VON=1 VOFF=0)
.ends SWhyste
***** Example models *****
.MODEL DN5819 D BV=5.33E+01 CJO=1.44E-10 EG=0.69
+ IBV=6.00E-04 IS=1.65E-05 M=.671 N=1.41 RS=4.47E-02
+ TT=7.20E-11 VJ=1.45 XTI=2
*****
.SUBCKT MC34063A 1 2 3 4 5 6 7 8
*BY KEHINDE OMOLAYO 2-20-03
*TERMINAL ID
*SWITCH COLLECTOR=1 SWITCH EMITTER=2 TIMING CAPACITOR=3 GND=4
*COMPARATOR INVERTING INPUT=5 VCC=6 IPK SENSE=7 DRIVER COLLECTOR=8

* Translation by Chris Basso

E1 10 0 5 4 1
R1 4 5 10MEG
V1 20 0 PULSE 0 2
E2 11 0 3 4 1
EB1 13 0 Value = { 1M/(ABS((27.475-195M*V(12))+(36.002+244M*V(12))*V(9)-
+(302.302+651M*V(12))*V(9)^2)+1F) }
E3 12 0 6 4 1
E4 9 0 6 7 1
R2 6 7 10MEG
EB2 14 0 Value = { 1M*((-10.765-151M*V(12))+(45.344+864M*V(12))*V(9)-
+(35.99+1.378*V(12))*V(9)^2+(8.341+839M*V(12))*V(9)^3) }
EB4 15 0 Value = { IF ( V(9)>0.32, V(14), V(13) ) }
C1 19 0 10P
EB5 16 0 Value = { IF ( V(20)1, 2, IF ( V(19)>1, 0, 2 ) ) ) }
R3 16 17 150
C2 17 0 10P
EB6 18 0 Value = { IF ( V(20)1, 0, IF ( V(11)1, 0, 2 ) ) ) ) }
R4 18 19 150
D1 4 3 DMC34063
D2 3 6 DMC34063
C3 11 31 1N
GB7 4 36 Value = { IF ( V(17)>1, -(224.4U+2.359U*V(12))*0.77, V(15)*0.77 ) }
C5 23 0 10P
EB9 21 0 Value = { IF ( V(20)1, 2, IF ( V(26)>1, 0, 2 ) ) ) }
R5 27 26 150
C6 26 0 10P
EB10 27 0 Value = { IF ( V(20)1, 0, IF ( V(10)1, 0, 2 ) ) ) ) }
R6 21 23 150
EB12 33 0 Value = { IF ( V(11)>(1.148+184.6M*V(29)), 2, 0 ) }
R13 33 24 10K
C8 24 0 10P
Q1 8 30 25 QSWITCH
Q2 1 25 2 QSWITCH
R15 25 2 100
D5 2 30 DMC34063
G1 2 30 26 23 5M
R16 2 4 10MEG
R23 31 28 1M
V6 28 0
V7 36 3
EB13 29 0 Value = { I(V6)/(I(V7)+866.8M*I(V6)) }
***
.MODEL DMC34063 D (CJO=2P N=0.05)
.MODEL QSWITCH NPN BF=75 CJC=2P IS=3E-9 RB=1 RC=0.45 RE=0
+ VJC=.75 VJE=.75 VJS=.75
***
.ENDS
*********

MC34063X.asy (goes in the /lib/sym folder)

Version 4
SymbolType CELL
LINE Normal -20 -128 -20 -112
LINE Normal 20 -128 20 -112
LINE Normal -8 -100 8 -100
RECTANGLE Normal -128 -128 128 128
ARC Normal -20 -124 4 -100 -20 -112 -8 -100
ARC Normal -4 -124 20 -100 8 -100 20 -112
WINDOW 0 0 -144 Center 0
WINDOW 3 0 144 Center 0
SYMATTR Value MC34063
SYMATTR Value2 MC34063
SYMATTR Prefix X
SYMATTR Spicemodel MC34063.lib
SYMATTR Description MC34063/NJM2360 1.5A Switching Regulator
PIN 128 -96 RIGHT 8
PINATTR PinName SW_col
PINATTR SpiceOrder 1
PIN -128 -96 LEFT 8
PINATTR PinName Drive_cnt
PINATTR SpiceOrder 8
PIN -128 32 LEFT 8
PINATTR PinName Vdd
PINATTR SpiceOrder 6
PIN -128 96 LEFT 8
PINATTR PinName Cinv
PINATTR SpiceOrder 5
PIN 128 32 RIGHT 8
PINATTR PinName Ct
PINATTR SpiceOrder 3
PIN 128 96 RIGHT 8
PINATTR PinName GND
PINATTR SpiceOrder 4
PIN 128 -32 RIGHT 8
PINATTR PinName SW_em
PINATTR SpiceOrder 2
PIN -128 -32 LEFT 8
PINATTR PinName Isense
PINATTR SpiceOrder 7

• Can you explain to me how the emitter of the NPN transistor inside MC34063 IC is able to turn on your external PNP transistor? Add an N-Channle MOSFET afte your PNP emiter (mosfet gate)\ – G36 Aug 2 '18 at 15:40
• That's a good question... can you explain it to me, I'm clearly missing some sort of route from the chip's emitter to ground? Yes the step after this is to add the FET, but I wanted to start with just a transistor. Am I think what you're saying is that I'm missing some sort of route from – Richard Aug 2 '18 at 15:45
• So replace your external PNP with a NPN transistor (emitter to GND, collector to the inductor). Do you now how NPN and PNP transistor work? – G36 Aug 2 '18 at 15:47
• No, not really. My understanding is that they pass current in opposite directions? How will swapping for an NPN work? – Richard Aug 2 '18 at 15:54
• Your edit - please look at the circuit in my answer and note that the internal collector goes to the inductor in this configuration. At the moment you are dumping hundreds of mA into the base of the external NPN. Basically, internal and external BJTs are wired as a "Darlington". If you do choose an external NFET then it's OK to leave the collector on the incoming supply after the current limit resistor but please don't blindly assume! – Andy aka Aug 2 '18 at 16:39

Q1 is always on. The output of the regulator is open collector; when it's "high" (off) it doesn't drive high, it's high impedance. The base current then flows from the emitter through R6, turning on the transistor.

R6 would serve you better placed between the base and emitter, rather than the collector. However, you will probably see that this setup is less efficient than direct drive due to the fact that Q1 is in an emitter follower configuration being driven from an open collector output, so it will "saturate" at about -0.9Vce rather than the 0.2Vce the NPN to ground offers.

You might consider a cheap NPN as an inverter and then a good, low ESR NFET to drive the switching node.

• Thank you. I half understand what you, and the others have said. As you can probably tell Electronics is not my strongest suite. I'm a control Systems engineer. Op Amps yes, transistors, no. I need to understand the fundamental difference between NPN and PNP BJT's clearly. – Richard Aug 2 '18 at 16:30

Prior to the change the internal transistor had emitter to ground and collector to the inductor. That worked.

After the change you tied the internal collector to the power rail and used the internal emitter. Instantly that introduces an inversion in the switching that MUST be countered by using an external transistor that inverts i.e. has it's collector to the inductor but you have used an emitter follower.

Basically, it needs an inverting transistor added and not a voltage follower.

See this in the data sheet: -

The left hand diagram shows a booster (step-up) circuit using an external NPN that inverts (collector out).

• From which datasheet did you get these two diagrams? I've been looking for the one on the left for a long time! Have I just overlooked it? – Richard Aug 2 '18 at 16:28
• The DS reference is MC34063A/D. – Andy aka Aug 2 '18 at 16:30

In short, to open a PNP transistor you need the voltage at the base to be lower than the emitter voltage (forward bias the emitter-base junction). And the base current need to flow-out off (leave the base terminal) the base terminal (PNP need a path for a current to "GND".)

On the other hand in NPN transistor need to forward bias the base-emitter junction. The voltage on the base must be larger than the voltage on emitter for about 0.6V. And base needs to flow into the base terminal.

Now in your present circuit, you have this situation:

simulate this circuit – Schematic created using CircuitLab

Now exam what is going on with the PNP transistor first.

As you can see the emitter is at the higher potential than the base terminal, but there is no path for a base current to "GND" (lower potential). So the PNP is OFF (Cut-off).

But if you replace your PNP with an NPN everything will work.

Why?

Because now we have the path for a current from Vcc to the base terminal.

So the NPN transistor can be open and so the collector-emitter current can now flow.

Look here at page 6 https://www.onsemi.com/pub/Collateral/MC34063A-D.PDF (figure.10)

• Q2's collector in your last diagram MUST now go to the inductor to form a Darlington else you get a whopping base current and likely destroy the external BJT. It's all shown on page 6! – Andy aka Aug 2 '18 at 16:41
• You are absolutely right. – G36 Aug 2 '18 at 16:44
• Thank you... In my simple world a transistor is a thing that passes current proportionally to the current flowing through the base, with some oddness I can't remember about 0.7v thrown in. I didn't fully appreciate the difference between the mechanisms by which PNP and NPN resistors 'turn on'. – Richard Aug 2 '18 at 16:55
• @Richard NPN transistor is a LOW side switch. Short-out the emitter with collector when the transistor is saturated and the emitter is at a lower potential than the collector. On the other hand, the PNP transistor is a High-side switch but this time the emitter needs to be at a higher potential than the collector. w9xt.com/img_1224968365_15264_1254155943_mod_290_220.jpg electronics.stackexchange.com/questions/276146/… – G36 Aug 2 '18 at 17:09


text:
Hide

Debug

While debugging a program Mirko noticed that a bug in the program may be linked with the existence of so called square killers in the program memory. The program memory is a matrix composed of $R$ rows and $C$ columns consisting only of zeroes and ones. A square killer is a square submatrix in memory, consisting of more than one character, that, when rotated $180$ degrees looks exactly the same. For example, the following matrix contains $3$ square killers:

101010      ....10      ......      101...
111001      ....01      ...00.      111...
101001      ......      ...00.      101...

memory      killer      killer      killer

Mirko is wondering if there is a connection between the size of the largest square killer and the bug in the program. Help Mirko by writing a program that, given the layout of the memory, outputs the size of the largest square killer. The size of the square killer is the number of rows (or columns) that the killer consists of. In the example above the killer sizes are $2$, $2$ and $3$, respectively.

Input

The first will contain two integers, $R$ and $C$, smaller than or equal to $300$. The next $R$ lines will each contain $C$ characters (‘0’ or ‘1’) with no spaces.

Output

Output the size of the largest killer on a single line, or output $-1$ if there are no square killers.

Sample Input 1 Sample Output 1
3 6
101010
111001
101001

3

Sample Input 2 Sample Output 2
4 5
10010
01010
10101
01001

3

Sample Input 3 Sample Output 3
3 3
101
111
100

-1

CPU Time limit 1 second
Memory limit 1024 MB
Difficulty 7.6hard
Statistics Show


text:
This is an old version, view current version.

# 8 Mixed Operations

These functions perform conversions between Stan containers matrix, vector, row vector and arrays.

matrix to_matrix(matrix m)
Return the matrix m itself.
Available since 2.3

matrix to_matrix(vector v)
Convert the column vector v to a size(v) by 1 matrix.
Available since 2.3

matrix to_matrix(row_vector v)
Convert the row vector v to a 1 by size(v) matrix.
Available since 2.3

matrix to_matrix(matrix m, int m, int n)
Convert a matrix m to a matrix with m rows and n columns filled in column-major order.
Available since 2.15

matrix to_matrix(vector v, int m, int n)
Convert a vector v to a matrix with m rows and n columns filled in column-major order.
Available since 2.15

matrix to_matrix(row_vector v, int m, int n)
Convert a row_vector a to a matrix with m rows and n columns filled in column-major order.
Available since 2.15

matrix to_matrix(matrix m, int m, int n, int col_major)
Convert a matrix m to a matrix with m rows and n columns filled in row-major order if col_major equals 0 (otherwise, they get filled in column-major order).
Available since 2.15

matrix to_matrix(vector v, int m, int n, int col_major)
Convert a vector v to a matrix with m rows and n columns filled in row-major order if col_major equals 0 (otherwise, they get filled in column-major order).
Available since 2.15

matrix to_matrix(row_vector v, int m, int n, int col_major)
Convert a row_vector a to a matrix with m rows and n columns filled in row-major order if col_major equals 0 (otherwise, they get filled in column-major order).
Available since 2.15

matrix to_matrix(array[] real a, int m, int n)
Convert a one-dimensional array a to a matrix with m rows and n columns filled in column-major order.
Available since 2.15

matrix to_matrix(array[] int a, int m, int n)
Convert a one-dimensional array a to a matrix with m rows and n columns filled in column-major order.
Available since 2.15

matrix to_matrix(array[] real a, int m, int n, int col_major)
Convert a one-dimensional array a to a matrix with m rows and n columns filled in row-major order if col_major equals 0 (otherwise, they get filled in column-major order).
Available since 2.15

matrix to_matrix(array[] int a, int m, int n, int col_major)
Convert a one-dimensional array a to a matrix with m rows and n columns filled in row-major order if col_major equals 0 (otherwise, they get filled in column-major order).
Available since 2.15

matrix to_matrix(array[,] real a)
Convert the two dimensional array a to a matrix with the same dimensions and indexing order.
Available since 2.3

matrix to_matrix(array[,] int a)
Convert the two dimensional array a to a matrix with the same dimensions and indexing order. If any of the dimensions of a are zero, the result will be a $$0 \times 0$$ matrix.
Available since 2.3

vector to_vector(matrix m)
Convert the matrix m to a column vector in column-major order.
Available since 2.0

vector to_vector(vector v)
Return the column vector v itself.
Available since 2.3

vector to_vector(row_vector v)
Convert the row vector v to a column vector.
Available since 2.3

vector to_vector(array[] real a)
Convert the one-dimensional array a to a column vector.
Available since 2.3

vector to_vector(array[] int a)
Convert the one-dimensional integer array a to a column vector.
Available since 2.3

row_vector to_row_vector(matrix m)
Convert the matrix m to a row vector in column-major order.
Available since 2.3

row_vector to_row_vector(vector v)
Convert the column vector v to a row vector.
Available since 2.3

row_vector to_row_vector(row_vector v)
Return the row vector v itself.
Available since 2.3

row_vector to_row_vector(array[] real a)
Convert the one-dimensional array a to a row vector.
Available since 2.3

row_vector to_row_vector(array[] int a)
Convert the one-dimensional array a to a row vector.
Available since 2.3

array[,] real to_array_2d(matrix m)
Convert the matrix m to a two dimensional array with the same dimensions and indexing order.
Available since 2.3

array[] real to_array_1d(vector v)
Convert the column vector v to a one-dimensional array.
Available since 2.3

array[] real to_array_1d(row_vector v)
Convert the row vector v to a one-dimensional array.
Available since 2.3

array[] real to_array_1d(matrix m)
Convert the matrix m to a one-dimensional array in column-major order.
Available since 2.3

array[] real to_array_1d(array[...] real a)
Convert the array a (of any dimension up to 10) to a one-dimensional array in row-major order.
Available since 2.3

array[] int to_array_1d(array[...] int a)
Convert the array a (of any dimension up to 10) to a one-dimensional array in row-major order.
Available since 2.3


text:
# Step-by-step Solution

## Integrate (cos(x)/x

Go
1
2
3
4
5
6
7
8
9
0
x
y
(◻)
◻/◻
2

e
π
ln
log
lim
d/dx
d/dx
>
<
>=
<=
sin
cos
tan
cot
sec
csc

asin
acos
atan
acot
asec
acsc

sinh
cosh
tanh
coth
sech
csch

asinh
acosh
atanh
acoth
asech
acsch

### Videos

$-\frac{1}{4320}x^{6}+\ln\left|x\right|-\frac{1}{4}x^2+\frac{1}{96}x^{4}+C_0$

## Step-by-step explanation

Problem to solve:

$\int\left(\frac{cos\left(x\right)}{x}\right)dx$
1

Use the Taylor series for rewrite the function $\cos\left(x\right)$ as an approximation: $\displaystyle f(x)=\sum_{n=0}^{\infty}\frac{f^{(n)}(a)}{n!}(x-a)^n$, with $a=0$. Here we will use only the first four terms of the serie

$\int\frac{\frac{-1}{6!}x^{6}+\frac{1}{0!}+\frac{-1}{2!}x^{2}+\frac{1}{4!}x^{4}}{x}dx$
2

Split the fraction $\frac{-\frac{1}{720}x^{6}+1-\frac{1}{2}x^{2}+\frac{1}{24}x^{4}}{x}$ in two terms with same denominator

$\int\left(\frac{-\frac{1}{720}x^{6}}{x}+\frac{1-\frac{1}{2}x^{2}+\frac{1}{24}x^{4}}{x}\right)dx$

$-\frac{1}{4320}x^{6}+\ln\left|x\right|-\frac{1}{4}x^2+\frac{1}{96}x^{4}+C_0$

### Struggling with math?

Access detailed step by step solutions to millions of problems, growing every day!

$\int\left(\frac{cos\left(x\right)}{x}\right)dx$

Taylor series

~ 1.22 seconds