problem – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Thu, 14 Mar 2024 16:44:01 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg problem – Programmerbay https://programmerbay.com 32 32 Counting Figures Tricks with Triangle Examples https://programmerbay.com/counting-figures-problem-tricks/ https://programmerbay.com/counting-figures-problem-tricks/#respond Tue, 12 Mar 2024 06:09:49 +0000 https://www.programmerbay.com/?p=4385 Counting figures problems come under non-verbal reasoning in which one is required to identify the exact count of a shape formed within a design or picture like a circle, square, triangle and more. Such type of logical reasoning questions are frequently asked in different aptitude exams.

Counting figures sometimes sound too difficult if you don’t have an idea of how to solve them. In this article, we will be talking about tricks for counting figures problem.

counting figures

These are most repeatedly asked reasoning questions. In this, a shape or a figure would be given to you and your task is to determine the shape and count it down within that particular shape.
For example, consider the below figure:

countinng figure 4

They simply ask in the question, how many triangles are visible in the given figure? Initially, it might look easy but it is obviously not! Without knowing tricks you can’t easily figure out correct answer.

 

Types of questions with Triangle Counting Problem Examples

  • When a triangle  is divided  by  vertical lines

    • In such a case, we use can n (n+1)/2 where n is the number of triangles inside the main triangle

Q.  Find the number of triangles in the diagram

counting figures 1

Number of  triangles  inside the  main triangle   =   4

4(4+1)/2

= 20/2    =    10

 

  •  When a  triangle divided  by the horizontal lines

    • In such a case, count the number of horizontal lines that would give you the total number of triangles

Q.  Find the number  of figures  in the diagram

counting figure 2

Total number of horizontal lines = 3

So total possible triangles are 3

 

  • When a triangle has both vertical and horizontal lines

    • n(n+2)/2 (for vertical lines ) * number of horizontal lines

Q.  Find the number  of triangles in the diagram

counting figures 3

Number of triangles from vertical lines (ignoring horizontal lines) = 3 = 3(3+1)/2 = 6

Horizontal lines  = 3

= 6* 3

= 18

 

  • When a triangle has an inner triangle touching all of the edges of the outer one

    • In such a case, there always 4 figures are made and add 1 for the main triangle

Q.  Find the number  of triangles in the diagram

countinng figure 4

Starting from inner combination there are  = 4 triangle

count me

outer combination there are  = 4 triangle

count me 1

And for main  = 1

total = 9 triangles

 

  • When a triangle has a triangle touching all of the edges of outer one and also has lines from each vertex of the main triangle touching edges of the inner one

    • In this first, ignore all the lines coming from corners of the triangle
    • Now the triangle you see would  be similar to the previous case triangle ( touching all the edges of outer triangle)
    • Count the number of triangles
    • After that consider lines coming from edges, each line would make 2 triangles
    • Now add them all together

counting figure 5

Step 1.  If we ignore the lines coming from edges, the figure would look like

countinng figure 4

Step 2.  From the inner triangle, we will get 4, from outer one = 4, Main triangle = 1

Step 3. Total triangles = 9

Step 4. Now add lines which were removed previously, if each line creates 2 triangles then 3 lines would create = 3*2 =6 triangle

Step 5. Add them all. 9 + 6 = 15 triangles

 

  •  When a triangle has multiple triangles made on horizontal lines 

    • If you look closely from every edge there would equal number of triangles
    • Count triangles from the base
    • Add them in a consecutive manner where the result of the previous one would be used as input for the next one. i.e 1 , 1 +2 = 3, 3+3=6, 4+6 =10′. Add all the sums together.
    • Now after adding them all up, also consider second last sum again
    • Also add it

counting figure 6

Number triangles in each base = 3

Make a counting from 1 to 3

count me 3

Add them up = 1 + 3 + 6 = 10

Now also consider second last item = 3

Total triangle 10 + 3 = 13

 

Counting Figures Practice Questions

 

1. How many triangles are there in the given figure?

Screenshot from 2024 03 14 22 03 30

2. How many triangles are there in the given figure?

Screenshot from 2024 03 14 22 04 34

3.  Find the number of triangles in the given figure :

Screenshot from 2024 03 14 22 08 35

Frequently Asked Questions:

What is the Figure Counting Reasoning?

It comes under non verbal reasoning section where one requires to identify and count the exact number of shapes present in the given figure or design.

]]>
https://programmerbay.com/counting-figures-problem-tricks/feed/ 0
Distance And Direction Reasoning Tricks with Example https://programmerbay.com/direction-problem-tricks/ https://programmerbay.com/direction-problem-tricks/#respond Sat, 15 Jul 2023 18:01:58 +0000 https://www.programmerbay.com/?p=4352 We will be discussing in this article about Direction sense. Questions of these types are easier than any other topics. In order to solve questions that come from the Direction Reasoning section, we have to first understand directions. These types of problems are more frequently asked questions in placements, job interviews and exams.

Distance and Direction Problem Basic Concept

Direction Reasoning tricks 1

  •  Direction problems revolve around two terms, Distance & Direction
  • There are 4 main directions: North, South, East, West
  • There are four cardinal directions: North-East, North-West, South-East, and South-West
  • The angle between major directions would be 90 degrees and between a major & a cardinal direction would be 90 degrees
  •  Making a left turn, would lead to a clockwise movement
  •  Making a right turn would lead to Anti-clockwise movement or turn
  •  In case of sunrise, if a person is facing east, then his should be toward the west
  • In the case of sunset, a person’s shadow would always be formed toward the east
  •  At noon, the sun positions vertically, therefore no shadow would be formed.

Screenshot from 2023 07 19 23 05 33

 

Screenshot from 2023 07 19 23 24 45

Here’s the direction reasoning trick, the below figure is used in almost every question of direction problem.

These are the 3 Types of Questions in Direction Reasoning

  •  Identify the direction of a walking person

Question. A man walks 5 km toward the south and then turns to the right. After walking 3 km he turns to the left and walks 5 km. Now in which direction is he from the starting place?

image 2020 12 06 131556

Answer: South -West

 

  • Identify the direction based on sunset or sunrise

    • Should Understand the concept of Shadow Direction reasoning to solve the related questions
      • In the case of sunrise, If a person is facing towards the east then his shadow would be formed to the west. In case of sunset, If a person is facing towards west then his shadow would be formed to the east.
      • In the case of sunrise, If a person is facing towards the north then his shadow would be formed to his left. In the case of sunset, If a person is facing towards north then his shadow would be formed to his right.
      • At noon, no shadow would be formed

Question. One evening before sunset Rekha and Hema were talking to each other face to face. If Hema’s shadow was exactly to the right of Hema, which direction was Rekha facing?

direction problem 2

Answer: South

 

Question. Reena starts walking early in the morning in the opposite direction to the sun. She then turns left and walks for 1 km and again takes a left turn. In which direction is she now?

1) West
2) North
3) East
4) South

Answer :

3) East

Screenshot from 2023 07 22 14 23 19

  • Find the nearest Distance

    • Should Understand the concept of Distance and Direction reasoning to solve the related questions
      • First, make lines as per directions in the question
      • You would end up with a right angle triangle
      • Apply Pythagoras theorem, (Hypotenuse)2 = (Base)2 + (Perpendicular)2

direction is here

Question. Suresh starting from his house goes 4 km in the East, then he turns to his right and goes 3 km. What minimum distance will be covered by him to come back to his house?

direction problem 3

(Hypotenuse)2 = (Base)2 + (Perpendicular)2

(Hypotenuse)2 = (3km)2 + (4km)2

(Hypotenuse)2 = 9km2 + 16km2

(Hypotenuse)2 = 25km2

Answer:  Hypotenuse = 5 km

  • A Direction Becomes equivalent or alias of Another Direction

In this type of question, a direction will become a new direction, based on that we need to find, what would be other directions become?

    • In this first, identify the relation between a given direction and its alias direction
    • The identification can be based on clockwise, degree, movement parameters
    • After identifying, use the same relation on the asked direction to get its alias

If North-East becomes North, then what will East become?
1) South-East
2) North-East
3) South-West
4) North-West

 

Screenshot from 2023 07 20 22 16 42

The answer will be North East

 Explanation:

1) The North-East becomes North. Considering the above picture, the movement is clockwise and shifts 45 degrees to become North direction.
2) Applying the same, East will become North East if we shift 45 degree and move further, clockwise.

  • Find Direction based on given degrees and turns

In this type of questions, degrees and the movement of a person are given. Based on that we need to find his final direction. The only thing one needs to consider, degree and facing position.

Question. A man is facing west and turns 45 degrees in the clockwise direction. He then turns another 180 degrees in the same direction and then 270 degree in anti clockwise direction. Which direction is he facing now?

  1. Man walks towards west
  2. He moves clockwise 45 degrees. Now he is facing towards North-West
  3. Again, he moves 180 degrees clockwise, that makes him positioned towards South-East
  4. Finally, he moves 270 degree anti clockwise, that makes him facing toward South-West

Answer is South-West

Screenshot from 2023 07 22 14 39 26

 

 

Below are some Mock Questions related to above example

1. A person walks 8 km, then he turned right & covered a distance of 3 km. After that, he turned left and covered a distance of 12 km. In the end, he was moving towards the north. From which direction, he started his journey?

1) North
2) East
3) South
4) West

2. If B is to north of A and C is to the east of B, in which direction is A with respect to C?

1) North-East
2) South-East
3) North-west
4) South-West

Answers:
1. South
2. South-west

]]>
https://programmerbay.com/direction-problem-tricks/feed/ 0
How to fix JRE or JDK must be available in order to run Eclipse problem https://programmerbay.com/jrk-or-jdk-must-be-available-in-order-to-run-eclipse-resolved/ https://programmerbay.com/jrk-or-jdk-must-be-available-in-order-to-run-eclipse-resolved/#respond Fri, 05 Jun 2020 16:44:26 +0000 https://programmerbay.com/?p=5646 While installing Eclipse on your system, you have came across a pop-up dialog preventing you from setting up the Eclipse environment. The dialog says:

A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after a search following locations:… Javaw.exe in your current PATH “.

eclipse JDK

So to resolve ” no java virtual machine was found eclipse … javaw.exe in your current path ” , do the following steps :

1) Download Java Development Kit first from here .

2) Locate javaw.exe file at ” C:\Program Files\Java\jdk-12\bin ”

eclipse 3 1

3) Copy the path and use the short command “Window+ Pause” to open System Information or “Control Panel\System and Security\System

4) Click on Advanced System settings and open Environment Variables

5) Under System Variable add a new path where you have to put the variable name as PATH and paste the path which you previously copied to Path value

path

6) Apply changes and now try to run the exe file of Eclipse.

Hope, above instructions helped you.

]]>
https://programmerbay.com/jrk-or-jdk-must-be-available-in-order-to-run-eclipse-resolved/feed/ 0
Find the equation of the Bezier curve which passes through (0,0) and (-4,2) and controlled through (14,10) and (4,0) https://programmerbay.com/find-the-equation-of-the-bezier-curve-which-passes-through-00-and-42-and-controlled-through-1410-and-40/ https://programmerbay.com/find-the-equation-of-the-bezier-curve-which-passes-through-00-and-42-and-controlled-through-1410-and-40/#respond Fri, 23 Nov 2018 16:30:45 +0000 https://www.programmerbay.com/?p=2134

Solution:

B(t) = ∑ki=0   PBk,n(t)         where, 0<=t<=1

It is given that curve passes (0,0) and (-4,2), means starting point of the curve is P0 = (0,0) and P3 = (-4,2)

Whereas the curve is controlled by P1 (14,10) and P2 (4,0)

Number of control points,

P0=(0,0) ,  P1=(14,10) , P2=(4,0)  , P3=(-4,2)

 

Degree of equation n =Control_point -1 = 4 -1 = 3

B(t) = P0B0,3(t)+ P1B1,3(t) + P2B2,3(t)+ P3B3,3(t)

Where,  Bk,n(t)=  nCk    uk (1-t)n-k

 

B0,3(t)3C0    t0 (1-t)3-0

=   1(1-t) 3

               =   1(1-t) 3

             (1-t)3

B1,3(t)3C1    u1 (1-t)3-1

=   t(1-t) 2

               =   t(1-t) 2

             =  3t (1-t)2

B2,3(t)3C2    t2 (1-t)3-2

=   t2(1-t) 1

               =   t2(1-t) 1

             3t2 (1-t)1

 

B3,3(t)=  3C3   u3 (1-t)3-3

=   t3(1-t) 0

               =   t3(1-t) 0

             t3

 

B(t)=      P0 (1-t)3 + P1 3t (1-t)2+ P2 3t2 (1-t)1+ P3 t3

Now, Using this equation lets calculate equation for x control point

P0=(0,0) ,  P1=(14,10) , P2=(4,0)  , P3=(-4,2)

= 0(1-t)3 + (14)  3t (1-t)2+ (4) 3t2 (1-t)+ (-4) t3

= 42t(t2+1-2t)+ 12t2(1-t)-4t3

= 42t3+42t-84t2+12t2-12t3-4t3

=26t3-72t2+42t

Using this equation lets calculate equation for y control points

= 0(1-t)3 + (10)  3t (1-t)2+ (0) 3t2 (1-t)+ (2) t3

=30t (1+t2-2t)+2t3

=30t+30t3-60t2+2t3

= 32t3 -60t2+30t

So, The answer is P(t) =[ x(t) y(t)] =[ (26t3-72t2+42t) (32t3 -60t2+30t)]

 

 

 

 

]]>
https://programmerbay.com/find-the-equation-of-the-bezier-curve-which-passes-through-00-and-42-and-controlled-through-1410-and-40/feed/ 0